|
26 | 26 | "metadata": {}, |
27 | 27 | "source": [ |
28 | 28 | "<div class=\"alert alert-block alert-info\">\n", |
29 | | -"<b>1.a. Comparision Operators</b>\n", |
| 29 | +"<b>1.a. Comparision Operators</b><br>\n", |
30 | 30 | "Comparision operators are used for comparing two values. The output is <b>True</b> or <b>False</b> .\n", |
31 | 31 | "</div>" |
32 | 32 | ] |
|
49 | 49 | "metadata": {}, |
50 | 50 | "source": [ |
51 | 51 | "<div class=\"alert alert-block alert-info\">\n", |
52 | | -"<b>1.b. Range</b>\n", |
53 | | -"A function that returns all integers between 2 arguments e.g range(x, y), including x but excluding y.\n", |
| 52 | +"<b>1.b. Range</b><br>\n", |
| 53 | +"A function that returns all integers between 2 arguments e.g range(x, y) including x but excluding y.\n", |
54 | 54 | "</div>" |
55 | 55 | ] |
56 | 56 | }, |
57 | 57 | { |
58 | 58 | "cell_type":"code", |
59 | | -"execution_count":1, |
| 59 | +"execution_count":3, |
60 | 60 | "metadata": {}, |
61 | 61 | "outputs": [ |
62 | 62 | { |
|
65 | 65 | "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]" |
66 | 66 | ] |
67 | 67 | }, |
68 | | -"execution_count":1, |
| 68 | +"execution_count":3, |
69 | 69 | "metadata": {}, |
70 | 70 | "output_type":"execute_result" |
71 | 71 | } |
|
78 | 78 | }, |
79 | 79 | { |
80 | 80 | "cell_type":"code", |
81 | | -"execution_count":2, |
| 81 | +"execution_count":4, |
82 | 82 | "metadata": {}, |
83 | 83 | "outputs": [ |
84 | 84 | { |
|
87 | 87 | "[0, 3, 6, 9]" |
88 | 88 | ] |
89 | 89 | }, |
90 | | -"execution_count":2, |
| 90 | +"execution_count":4, |
91 | 91 | "metadata": {}, |
92 | 92 | "output_type":"execute_result" |
93 | 93 | } |
|
103 | 103 | "metadata": {}, |
104 | 104 | "source": [ |
105 | 105 | "<div class=\"alert alert-block alert-info\">\n", |
106 | | -"<b>1.c. For Loop</b>\n", |
| 106 | +"<b>1.c. For Loop</b><br>\n", |
107 | 107 | "For loop is used to repeat a block of code fixed number of times or break in between by some condition.\n", |
108 | 108 | "</div>" |
109 | 109 | ] |
|
129 | 129 | }, |
130 | 130 | { |
131 | 131 | "cell_type":"code", |
132 | | -"execution_count":10, |
| 132 | +"execution_count":6, |
133 | 133 | "metadata": {}, |
134 | 134 | "outputs": [ |
135 | 135 | { |
|
149 | 149 | }, |
150 | 150 | { |
151 | 151 | "cell_type":"code", |
152 | | -"execution_count":12, |
| 152 | +"execution_count":7, |
153 | 153 | "metadata": {}, |
154 | 154 | "outputs": [ |
155 | 155 | { |
|
158 | 158 | "[2, 5, 8]" |
159 | 159 | ] |
160 | 160 | }, |
161 | | -"execution_count":12, |
| 161 | +"execution_count":7, |
162 | 162 | "metadata": {}, |
163 | 163 | "output_type":"execute_result" |
164 | 164 | } |
|
177 | 177 | }, |
178 | 178 | { |
179 | 179 | "cell_type":"code", |
180 | | -"execution_count":14, |
| 180 | +"execution_count":8, |
181 | 181 | "metadata": {}, |
182 | 182 | "outputs": [ |
183 | 183 | { |
|
197 | 197 | }, |
198 | 198 | { |
199 | 199 | "cell_type":"code", |
200 | | -"execution_count":15, |
| 200 | +"execution_count":9, |
201 | 201 | "metadata": {}, |
202 | 202 | "outputs": [ |
203 | 203 | { |
|
216 | 216 | }, |
217 | 217 | { |
218 | 218 | "cell_type":"code", |
219 | | -"execution_count":16, |
| 219 | +"execution_count":10, |
220 | 220 | "metadata": {}, |
221 | 221 | "outputs": [ |
222 | 222 | { |
|
238 | 238 | "metadata": {}, |
239 | 239 | "source": [ |
240 | 240 | "<div class=\"alert alert-block alert-info\">\n", |
241 | | -"<b>1.d. While Loop</b>\n", |
| 241 | +"<b>1.d. While Loop</b><br>\n", |
242 | 242 | "While loop is used to run a block of code multiple times until the condition is met.\n", |
243 | 243 | "</div>" |
244 | 244 | ] |
245 | 245 | }, |
246 | 246 | { |
247 | 247 | "cell_type":"code", |
248 | | -"execution_count":1, |
| 248 | +"execution_count":11, |
249 | 249 | "metadata": {}, |
250 | 250 | "outputs": [ |
251 | 251 | { |
|
269 | 269 | "metadata": {}, |
270 | 270 | "source": [ |
271 | 271 | "<div class=\"alert alert-block alert-info\">\n", |
272 | | -"<b>1.e. If Else Condition</b>\n", |
273 | | -"Conditional statement : if code block is executed if the condition is met.\n", |
274 | | -"Else is Optional and is executed in case 'if' fails.\n", |
275 | | -"For multiple else use 'elif'\n", |
| 272 | +"<b>1.e. If Else Condition</b><br>\n", |
| 273 | +"Conditional statement : if code block is executed if the condition is met.<br>\n", |
| 274 | +"Else is Optional and is executed in case 'if' fails.<br>\n", |
| 275 | +"For multiple else use 'elif'.\n", |
276 | 276 | "</div>" |
277 | 277 | ] |
278 | 278 | }, |
279 | 279 | { |
280 | 280 | "cell_type":"code", |
281 | | -"execution_count":2, |
| 281 | +"execution_count":12, |
282 | 282 | "metadata": {}, |
283 | 283 | "outputs": [ |
284 | 284 | { |
|