Skip to content

Commit 164d3d2

Browse files
Add files via upload
0 parents  commit 164d3d2

11 files changed

+2680
-0
lines changed

Python Array.ipynb

+471
Large diffs are not rendered by default.
+260
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,260 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 6,
6+
"id": "ebfaff7a",
7+
"metadata": {},
8+
"outputs": [
9+
{
10+
"name": "stdout",
11+
"output_type": "stream",
12+
"text": [
13+
"0\n",
14+
"1\n",
15+
"2\n",
16+
"3\n"
17+
]
18+
}
19+
],
20+
"source": [
21+
"for i in range(100):\n",
22+
" if i==4:\n",
23+
" break\n",
24+
" print(i)"
25+
]
26+
},
27+
{
28+
"cell_type": "code",
29+
"execution_count": 13,
30+
"id": "48cffe69",
31+
"metadata": {},
32+
"outputs": [
33+
{
34+
"name": "stdout",
35+
"output_type": "stream",
36+
"text": [
37+
"3* 1 = 3\n",
38+
"3* 2 = 6\n",
39+
"3* 3 = 9\n",
40+
"3* 4 = 12\n",
41+
"3* 5 = 15\n",
42+
"3* 6 = 18\n",
43+
"3* 7 = 21\n",
44+
"3* 8 = 24\n",
45+
"3* 9 = 27\n",
46+
"3* 10 = 30\n"
47+
]
48+
}
49+
],
50+
"source": [
51+
"for i in range(1,100):\n",
52+
" if i ==11:\n",
53+
" break\n",
54+
" print('3*',i,'=',i*3)\n",
55+
" "
56+
]
57+
},
58+
{
59+
"cell_type": "code",
60+
"execution_count": 20,
61+
"id": "9e45a13c",
62+
"metadata": {},
63+
"outputs": [
64+
{
65+
"name": "stdout",
66+
"output_type": "stream",
67+
"text": [
68+
"I\n",
69+
"live\n",
70+
"in\n",
71+
"Dhaka\n"
72+
]
73+
}
74+
],
75+
"source": [
76+
"sen ='I live in Dhaka at my home'\n",
77+
"\n",
78+
"for i in sen.split():\n",
79+
" if i=='at':\n",
80+
" break\n",
81+
" print(i)\n",
82+
" "
83+
]
84+
},
85+
{
86+
"cell_type": "code",
87+
"execution_count": null,
88+
"id": "98c86794",
89+
"metadata": {},
90+
"outputs": [],
91+
"source": [
92+
"#while\n",
93+
"for i in range(1,100):\n",
94+
" if i ==11:\n",
95+
" break\n",
96+
" print('3*',i,'=',i*3)"
97+
]
98+
},
99+
{
100+
"cell_type": "code",
101+
"execution_count": 21,
102+
"id": "88666237",
103+
"metadata": {},
104+
"outputs": [
105+
{
106+
"name": "stdout",
107+
"output_type": "stream",
108+
"text": [
109+
"10* 1 = 10\n",
110+
"10* 2 = 20\n",
111+
"10* 3 = 30\n",
112+
"10* 4 = 40\n",
113+
"10* 5 = 50\n",
114+
"10* 6 = 60\n",
115+
"10* 7 = 70\n",
116+
"10* 8 = 80\n",
117+
"10* 9 = 90\n",
118+
"10* 10 = 100\n"
119+
]
120+
}
121+
],
122+
"source": [
123+
"i=1\n",
124+
"\n",
125+
"while i<=100:\n",
126+
" if i ==11:\n",
127+
" break\n",
128+
" print('10*',i,'=', i*10)\n",
129+
" i=i+1"
130+
]
131+
},
132+
{
133+
"cell_type": "markdown",
134+
"id": "d8366a99",
135+
"metadata": {},
136+
"source": [
137+
"# Continue statement\n",
138+
"\n"
139+
]
140+
},
141+
{
142+
"cell_type": "code",
143+
"execution_count": 34,
144+
"id": "7244c227",
145+
"metadata": {},
146+
"outputs": [
147+
{
148+
"data": {
149+
"text/plain": [
150+
"[1, 2, 3, 4, 6, 7, 8, 9, 10]"
151+
]
152+
},
153+
"execution_count": 34,
154+
"metadata": {},
155+
"output_type": "execute_result"
156+
}
157+
],
158+
"source": [
159+
"num=[1,2,3,4,6,7,8,9,10]\n",
160+
"num"
161+
]
162+
},
163+
{
164+
"cell_type": "code",
165+
"execution_count": 35,
166+
"id": "82b4b43e",
167+
"metadata": {},
168+
"outputs": [
169+
{
170+
"data": {
171+
"text/plain": [
172+
"[2, 4, 6, 8, 10]"
173+
]
174+
},
175+
"execution_count": 35,
176+
"metadata": {},
177+
"output_type": "execute_result"
178+
}
179+
],
180+
"source": [
181+
"[i for i in num if i%2==0]"
182+
]
183+
},
184+
{
185+
"cell_type": "code",
186+
"execution_count": 36,
187+
"id": "c8529de9",
188+
"metadata": {},
189+
"outputs": [
190+
{
191+
"name": "stdout",
192+
"output_type": "stream",
193+
"text": [
194+
"2\n",
195+
"4\n",
196+
"6\n",
197+
"8\n",
198+
"10\n"
199+
]
200+
}
201+
],
202+
"source": [
203+
"for i in num:\n",
204+
" if i%2==1:\n",
205+
" continue\n",
206+
" print(i)"
207+
]
208+
},
209+
{
210+
"cell_type": "code",
211+
"execution_count": 40,
212+
"id": "635b0d3a",
213+
"metadata": {},
214+
"outputs": [
215+
{
216+
"name": "stdout",
217+
"output_type": "stream",
218+
"text": [
219+
"I\n",
220+
"live\n",
221+
"in\n",
222+
"Dhaka\n",
223+
"my\n",
224+
"home\n"
225+
]
226+
}
227+
],
228+
"source": [
229+
"sen ='I live in Dhaka at my home'\n",
230+
"\n",
231+
"for i in sen.split():\n",
232+
" if i=='at':\n",
233+
" continue\n",
234+
" print(i)\n",
235+
" "
236+
]
237+
}
238+
],
239+
"metadata": {
240+
"kernelspec": {
241+
"display_name": "Python 3 (ipykernel)",
242+
"language": "python",
243+
"name": "python3"
244+
},
245+
"language_info": {
246+
"codemirror_mode": {
247+
"name": "ipython",
248+
"version": 3
249+
},
250+
"file_extension": ".py",
251+
"mimetype": "text/x-python",
252+
"name": "python",
253+
"nbconvert_exporter": "python",
254+
"pygments_lexer": "ipython3",
255+
"version": "3.9.13"
256+
}
257+
},
258+
"nbformat": 4,
259+
"nbformat_minor": 5
260+
}

0 commit comments

Comments
 (0)