Skip to content

Commit cbfab1e

Browse files
author
SuRu
committed
moved files from old repo
1 parent ce0e7a0 commit cbfab1e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+123148
-0
lines changed

Playground.ipynb

+370
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,370 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 7,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"def testing_return(number):\n",
10+
" if number % 2 == 0:\n",
11+
" print('Even and SKIP everything')\n",
12+
" return\n",
13+
" else:\n",
14+
" print('ODD Continue')\n",
15+
" print('rest of the function')"
16+
]
17+
},
18+
{
19+
"cell_type": "code",
20+
"execution_count": 5,
21+
"metadata": {},
22+
"outputs": [
23+
{
24+
"name": "stdout",
25+
"output_type": "stream",
26+
"text": [
27+
"ODD Continue\n",
28+
"rest of the function\n"
29+
]
30+
}
31+
],
32+
"source": [
33+
"testing_return(221)"
34+
]
35+
},
36+
{
37+
"cell_type": "code",
38+
"execution_count": 6,
39+
"metadata": {},
40+
"outputs": [
41+
{
42+
"name": "stdout",
43+
"output_type": "stream",
44+
"text": [
45+
"Even and SKIP everything\n"
46+
]
47+
}
48+
],
49+
"source": [
50+
"testing_return(6)"
51+
]
52+
},
53+
{
54+
"cell_type": "code",
55+
"execution_count": 8,
56+
"metadata": {},
57+
"outputs": [
58+
{
59+
"name": "stdout",
60+
"output_type": "stream",
61+
"text": [
62+
"4.5\n"
63+
]
64+
}
65+
],
66+
"source": [
67+
"print(9 / 2)"
68+
]
69+
},
70+
{
71+
"cell_type": "code",
72+
"execution_count": 9,
73+
"metadata": {},
74+
"outputs": [
75+
{
76+
"name": "stdout",
77+
"output_type": "stream",
78+
"text": [
79+
"4\n"
80+
]
81+
}
82+
],
83+
"source": [
84+
"print(9 // 2)"
85+
]
86+
},
87+
{
88+
"cell_type": "code",
89+
"execution_count": 10,
90+
"metadata": {},
91+
"outputs": [
92+
{
93+
"name": "stdout",
94+
"output_type": "stream",
95+
"text": [
96+
"1\n"
97+
]
98+
}
99+
],
100+
"source": [
101+
"print(9 % 2)"
102+
]
103+
},
104+
{
105+
"cell_type": "code",
106+
"execution_count": 12,
107+
"metadata": {},
108+
"outputs": [
109+
{
110+
"name": "stdout",
111+
"output_type": "stream",
112+
"text": [
113+
"81\n"
114+
]
115+
}
116+
],
117+
"source": [
118+
"print(9 ** 2) # 9 squere"
119+
]
120+
},
121+
{
122+
"cell_type": "code",
123+
"execution_count": 13,
124+
"metadata": {},
125+
"outputs": [
126+
{
127+
"name": "stdout",
128+
"output_type": "stream",
129+
"text": [
130+
"729\n"
131+
]
132+
}
133+
],
134+
"source": [
135+
"print(9 ** 3) # 9 cube"
136+
]
137+
},
138+
{
139+
"cell_type": "markdown",
140+
"metadata": {},
141+
"source": [
142+
"**Logical AND**\n",
143+
"\n",
144+
"```\n",
145+
"2 0 0 1 0\n",
146+
"3 0 0 1 1\n",
147+
"----------\n",
148+
"2 0 0 1 0\n",
149+
"```"
150+
]
151+
},
152+
{
153+
"cell_type": "code",
154+
"execution_count": 14,
155+
"metadata": {},
156+
"outputs": [
157+
{
158+
"data": {
159+
"text/plain": [
160+
"2"
161+
]
162+
},
163+
"execution_count": 14,
164+
"metadata": {},
165+
"output_type": "execute_result"
166+
}
167+
],
168+
"source": [
169+
"2 & 3"
170+
]
171+
},
172+
{
173+
"cell_type": "markdown",
174+
"metadata": {},
175+
"source": [
176+
"**Logical OR**\n",
177+
"\n",
178+
"```\n",
179+
"2 0 0 1 0\n",
180+
"3 0 0 1 1\n",
181+
"----------\n",
182+
"2 0 0 1 1\n",
183+
"```"
184+
]
185+
},
186+
{
187+
"cell_type": "code",
188+
"execution_count": 15,
189+
"metadata": {},
190+
"outputs": [
191+
{
192+
"data": {
193+
"text/plain": [
194+
"3"
195+
]
196+
},
197+
"execution_count": 15,
198+
"metadata": {},
199+
"output_type": "execute_result"
200+
}
201+
],
202+
"source": [
203+
"2 | 3"
204+
]
205+
},
206+
{
207+
"cell_type": "markdown",
208+
"metadata": {},
209+
"source": [
210+
"**Logical XOR**\n",
211+
"\n",
212+
"```\n",
213+
"10 1 0 1 0\n",
214+
"13 1 1 0 1\n",
215+
"----------\n",
216+
"07 0 1 1 1\n",
217+
"```"
218+
]
219+
},
220+
{
221+
"cell_type": "code",
222+
"execution_count": 17,
223+
"metadata": {},
224+
"outputs": [
225+
{
226+
"data": {
227+
"text/plain": [
228+
"7"
229+
]
230+
},
231+
"execution_count": 17,
232+
"metadata": {},
233+
"output_type": "execute_result"
234+
}
235+
],
236+
"source": [
237+
"10 ^ 13"
238+
]
239+
},
240+
{
241+
"cell_type": "code",
242+
"execution_count": 19,
243+
"metadata": {},
244+
"outputs": [
245+
{
246+
"data": {
247+
"text/plain": [
248+
"-17"
249+
]
250+
},
251+
"execution_count": 19,
252+
"metadata": {},
253+
"output_type": "execute_result"
254+
}
255+
],
256+
"source": [
257+
"~16"
258+
]
259+
},
260+
{
261+
"cell_type": "code",
262+
"execution_count": 22,
263+
"metadata": {},
264+
"outputs": [
265+
{
266+
"name": "stdout",
267+
"output_type": "stream",
268+
"text": [
269+
"Num: 21, Bin: 0b10101, Oct: 0o25, Hex: 0x15\n"
270+
]
271+
}
272+
],
273+
"source": [
274+
"num = 21\n",
275+
"print('Num: {}, Bin: {}, Oct: {}, Hex: {}'.format(num, bin(num), oct(num), hex(num)))"
276+
]
277+
},
278+
{
279+
"cell_type": "code",
280+
"execution_count": 1,
281+
"metadata": {},
282+
"outputs": [
283+
{
284+
"name": "stdout",
285+
"output_type": "stream",
286+
"text": [
287+
"Num: 256, Bin: 0b100000000, Oct: 0o400, Hex: 0x100\n"
288+
]
289+
}
290+
],
291+
"source": [
292+
"num = 256\n",
293+
"print('Num: {}, Bin: {}, Oct: {}, Hex: {}'.format(num, bin(num), oct(num), hex(num)))"
294+
]
295+
},
296+
{
297+
"cell_type": "markdown",
298+
"metadata": {},
299+
"source": [
300+
"#### Get user home directory"
301+
]
302+
},
303+
{
304+
"cell_type": "code",
305+
"execution_count": 3,
306+
"metadata": {},
307+
"outputs": [
308+
{
309+
"name": "stdout",
310+
"output_type": "stream",
311+
"text": [
312+
"/Users/surendra\n"
313+
]
314+
}
315+
],
316+
"source": [
317+
"from pathlib import Path\n",
318+
"home = str(Path.home())\n",
319+
"print(home)"
320+
]
321+
},
322+
{
323+
"cell_type": "code",
324+
"execution_count": 4,
325+
"metadata": {},
326+
"outputs": [
327+
{
328+
"name": "stdout",
329+
"output_type": "stream",
330+
"text": [
331+
"/Users/surendra\n"
332+
]
333+
}
334+
],
335+
"source": [
336+
"from os.path import expanduser\n",
337+
"home = expanduser(\"~\")\n",
338+
"print(home)"
339+
]
340+
},
341+
{
342+
"cell_type": "code",
343+
"execution_count": null,
344+
"metadata": {},
345+
"outputs": [],
346+
"source": []
347+
}
348+
],
349+
"metadata": {
350+
"kernelspec": {
351+
"display_name": "Python 3",
352+
"language": "python",
353+
"name": "python3"
354+
},
355+
"language_info": {
356+
"codemirror_mode": {
357+
"name": "ipython",
358+
"version": 3
359+
},
360+
"file_extension": ".py",
361+
"mimetype": "text/x-python",
362+
"name": "python",
363+
"nbconvert_exporter": "python",
364+
"pygments_lexer": "ipython3",
365+
"version": "3.6.7"
366+
}
367+
},
368+
"nbformat": 4,
369+
"nbformat_minor": 2
370+
}

0 commit comments

Comments
 (0)