Skip to content

Commit 78fbb40

Browse files
Add files via upload
1 parent e7489a9 commit 78fbb40

File tree

38 files changed

+23024
-0
lines changed

38 files changed

+23024
-0
lines changed

Sec V Python Statements.ipynb

+951
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"For Loop"
8+
]
9+
},
10+
{
11+
"cell_type": "code",
12+
"execution_count": 1,
13+
"metadata": {},
14+
"outputs": [
15+
{
16+
"name": "stdout",
17+
"output_type": "stream",
18+
"text": [
19+
"Laddu\n"
20+
]
21+
}
22+
],
23+
"source": [
24+
"# Pass in 'for Loop'\n",
25+
"\n",
26+
"z = [1,2,3]\n",
27+
"\n",
28+
"for dicky in z:\n",
29+
" pass\n",
30+
"# the code does not execute nor throw an error but we can do other works.\n",
31+
"\n",
32+
"print('Laddu')\n"
33+
]
34+
},
35+
{
36+
"cell_type": "code",
37+
"execution_count": 2,
38+
"metadata": {},
39+
"outputs": [
40+
{
41+
"name": "stdout",
42+
"output_type": "stream",
43+
"text": [
44+
"hallo\n"
45+
]
46+
}
47+
],
48+
"source": [
49+
"print(\"hallo\")"
50+
]
51+
},
52+
{
53+
"cell_type": "code",
54+
"execution_count": 3,
55+
"metadata": {},
56+
"outputs": [
57+
{
58+
"name": "stdout",
59+
"output_type": "stream",
60+
"text": [
61+
"t\n",
62+
"p\n",
63+
" \n",
64+
"f\n",
65+
" \n",
66+
"t\n",
67+
"h\n",
68+
"e\n",
69+
" \n",
70+
"w\n",
71+
"r\n",
72+
"l\n",
73+
"d\n"
74+
]
75+
}
76+
],
77+
"source": [
78+
"# Continue in for loop\n",
79+
"\n",
80+
"s = (\"top of the world\")\n",
81+
"\n",
82+
"for letters in s:\n",
83+
" if letters == 'o':\n",
84+
" continue\n",
85+
" \n",
86+
" print(letters) "
87+
]
88+
},
89+
{
90+
"cell_type": "markdown",
91+
"metadata": {},
92+
"source": [
93+
"While Loop"
94+
]
95+
},
96+
{
97+
"cell_type": "code",
98+
"execution_count": 18,
99+
"metadata": {},
100+
"outputs": [
101+
{
102+
"name": "stdout",
103+
"output_type": "stream",
104+
"text": [
105+
"1\n",
106+
"2\n",
107+
"3\n",
108+
"4\n"
109+
]
110+
}
111+
],
112+
"source": [
113+
"# while loop\n",
114+
"\n",
115+
"z = 1\n",
116+
"\n",
117+
"while z < 5:\n",
118+
" \n",
119+
" print(z)\n",
120+
" \n",
121+
" z +=1\n",
122+
" \n",
123+
" "
124+
]
125+
},
126+
{
127+
"cell_type": "code",
128+
"execution_count": 32,
129+
"metadata": {},
130+
"outputs": [
131+
{
132+
"name": "stdout",
133+
"output_type": "stream",
134+
"text": [
135+
"t\n",
136+
"o\n",
137+
"p\n",
138+
" \n",
139+
"o\n",
140+
"f\n",
141+
" \n",
142+
"t\n",
143+
"h\n"
144+
]
145+
}
146+
],
147+
"source": [
148+
"# Break in for loop\n",
149+
"\n",
150+
"s = (\"top of the world\")\n",
151+
"\n",
152+
"for letters in s:\n",
153+
" if letters == 'e':\n",
154+
" break\n",
155+
" print(letters)"
156+
]
157+
},
158+
{
159+
"cell_type": "code",
160+
"execution_count": null,
161+
"metadata": {},
162+
"outputs": [],
163+
"source": []
164+
}
165+
],
166+
"metadata": {
167+
"kernelspec": {
168+
"display_name": "Python 3",
169+
"language": "python",
170+
"name": "python3"
171+
},
172+
"language_info": {
173+
"codemirror_mode": {
174+
"name": "ipython",
175+
"version": 3
176+
},
177+
"file_extension": ".py",
178+
"mimetype": "text/x-python",
179+
"name": "python",
180+
"nbconvert_exporter": "python",
181+
"pygments_lexer": "ipython3",
182+
"version": "3.8.5"
183+
}
184+
},
185+
"nbformat": 4,
186+
"nbformat_minor": 4
187+
}

0 commit comments

Comments
 (0)