|
2 | 2 | "cells": [ |
3 | 3 | { |
4 | 4 | "cell_type": "code", |
5 | | - "execution_count": 37, |
| 5 | + "execution_count": null, |
6 | 6 | "metadata": {}, |
7 | | - "outputs": [ |
8 | | - { |
9 | | - "name": "stdout", |
10 | | - "output_type": "stream", |
11 | | - "text": [ |
12 | | - "35\n" |
13 | | - ] |
14 | | - } |
15 | | - ], |
| 7 | + "outputs": [], |
16 | 8 | "source": [ |
17 | 9 | "x = 7\n", |
18 | 10 | "y = 5\n", |
|
22 | 14 | }, |
23 | 15 | { |
24 | 16 | "cell_type": "code", |
25 | | - "execution_count": 38, |
| 17 | + "execution_count": null, |
26 | 18 | "metadata": {}, |
27 | | - "outputs": [ |
28 | | - { |
29 | | - "name": "stdout", |
30 | | - "output_type": "stream", |
31 | | - "text": [ |
32 | | - "3\n" |
33 | | - ] |
34 | | - } |
35 | | - ], |
| 19 | + "outputs": [], |
36 | 20 | "source": [ |
37 | 21 | "a = 10\n", |
38 | 22 | "b = a // 3\n", |
|
41 | 25 | }, |
42 | 26 | { |
43 | 27 | "cell_type": "code", |
44 | | - "execution_count": 39, |
| 28 | + "execution_count": null, |
45 | 29 | "metadata": {}, |
46 | | - "outputs": [ |
47 | | - { |
48 | | - "name": "stdout", |
49 | | - "output_type": "stream", |
50 | | - "text": [ |
51 | | - "<class 'float'>\n" |
52 | | - ] |
53 | | - } |
54 | | - ], |
| 30 | + "outputs": [], |
55 | 31 | "source": [ |
56 | 32 | "num = 3.14\n", |
57 | 33 | "print(type(num))" |
58 | 34 | ] |
59 | 35 | }, |
60 | 36 | { |
61 | 37 | "cell_type": "code", |
62 | | - "execution_count": 40, |
| 38 | + "execution_count": null, |
63 | 39 | "metadata": {}, |
64 | | - "outputs": [ |
65 | | - { |
66 | | - "name": "stdout", |
67 | | - "output_type": "stream", |
68 | | - "text": [ |
69 | | - "2.75\n" |
70 | | - ] |
71 | | - } |
72 | | - ], |
| 40 | + "outputs": [], |
73 | 41 | "source": [ |
74 | 42 | "a = 5.5\n", |
75 | 43 | "b = 2.0\n", |
|
79 | 47 | }, |
80 | 48 | { |
81 | 49 | "cell_type": "code", |
82 | | - "execution_count": 41, |
| 50 | + "execution_count": null, |
83 | 51 | "metadata": {}, |
84 | | - "outputs": [ |
85 | | - { |
86 | | - "name": "stdout", |
87 | | - "output_type": "stream", |
88 | | - "text": [ |
89 | | - "False\n" |
90 | | - ] |
91 | | - } |
92 | | - ], |
| 52 | + "outputs": [], |
93 | 53 | "source": [ |
94 | 54 | "a = True\n", |
95 | 55 | "b = False\n", |
|
98 | 58 | }, |
99 | 59 | { |
100 | 60 | "cell_type": "code", |
101 | | - "execution_count": 42, |
| 61 | + "execution_count": null, |
102 | 62 | "metadata": {}, |
103 | | - "outputs": [ |
104 | | - { |
105 | | - "name": "stdout", |
106 | | - "output_type": "stream", |
107 | | - "text": [ |
108 | | - "False\n" |
109 | | - ] |
110 | | - } |
111 | | - ], |
| 63 | + "outputs": [], |
112 | 64 | "source": [ |
113 | 65 | "x = not True\n", |
114 | 66 | "print(x)" |
115 | 67 | ] |
116 | 68 | }, |
117 | 69 | { |
118 | 70 | "cell_type": "code", |
119 | | - "execution_count": 43, |
| 71 | + "execution_count": null, |
120 | 72 | "metadata": {}, |
121 | | - "outputs": [ |
122 | | - { |
123 | | - "name": "stdout", |
124 | | - "output_type": "stream", |
125 | | - "text": [ |
126 | | - "HelloWorld\n" |
127 | | - ] |
128 | | - } |
129 | | - ], |
| 73 | + "outputs": [], |
130 | 74 | "source": [ |
131 | 75 | "text = \"Hello\" + \"World\"\n", |
132 | 76 | "print(text)" |
133 | 77 | ] |
134 | 78 | }, |
135 | 79 | { |
136 | 80 | "cell_type": "code", |
137 | | - "execution_count": 44, |
| 81 | + "execution_count": null, |
138 | 82 | "metadata": {}, |
139 | | - "outputs": [ |
140 | | - { |
141 | | - "name": "stdout", |
142 | | - "output_type": "stream", |
143 | | - "text": [ |
144 | | - "lic\n" |
145 | | - ] |
146 | | - } |
147 | | - ], |
| 83 | + "outputs": [], |
148 | 84 | "source": [ |
149 | 85 | "name = \"Alice\"\n", |
150 | 86 | "print(name[1:4])\n" |
151 | 87 | ] |
152 | 88 | }, |
153 | 89 | { |
154 | 90 | "cell_type": "code", |
155 | | - "execution_count": 45, |
| 91 | + "execution_count": null, |
156 | 92 | "metadata": {}, |
157 | | - "outputs": [ |
158 | | - { |
159 | | - "name": "stdout", |
160 | | - "output_type": "stream", |
161 | | - "text": [ |
162 | | - "[1, 2, 3, 4, 5]\n" |
163 | | - ] |
164 | | - } |
165 | | - ], |
| 93 | + "outputs": [], |
166 | 94 | "source": [ |
167 | 95 | "my_list = [1, 2, 3, 4]\n", |
168 | 96 | "my_list.append(5)\n", |
|
171 | 99 | }, |
172 | 100 | { |
173 | 101 | "cell_type": "code", |
174 | | - "execution_count": 46, |
| 102 | + "execution_count": null, |
175 | 103 | "metadata": {}, |
176 | | - "outputs": [ |
177 | | - { |
178 | | - "name": "stdout", |
179 | | - "output_type": "stream", |
180 | | - "text": [ |
181 | | - "[1, 4, 5, 3]\n" |
182 | | - ] |
183 | | - } |
184 | | - ], |
| 104 | + "outputs": [], |
185 | 105 | "source": [ |
186 | 106 | "nums =[1,2,3]\n", |
187 | 107 | "nums[1:2]=[4,5]\n", |
|
190 | 110 | }, |
191 | 111 | { |
192 | 112 | "cell_type": "code", |
193 | | - "execution_count": 47, |
| 113 | + "execution_count": null, |
194 | 114 | "metadata": {}, |
195 | | - "outputs": [ |
196 | | - { |
197 | | - "name": "stdout", |
198 | | - "output_type": "stream", |
199 | | - "text": [ |
200 | | - "3\n" |
201 | | - ] |
202 | | - } |
203 | | - ], |
| 115 | + "outputs": [], |
204 | 116 | "source": [ |
205 | 117 | "my_tuple = (1, 2, 3)\n", |
206 | 118 | "print(my_tuple[2])" |
207 | 119 | ] |
208 | 120 | }, |
209 | 121 | { |
210 | 122 | "cell_type": "code", |
211 | | - "execution_count": 48, |
| 123 | + "execution_count": null, |
212 | 124 | "metadata": {}, |
213 | | - "outputs": [ |
214 | | - { |
215 | | - "name": "stdout", |
216 | | - "output_type": "stream", |
217 | | - "text": [ |
218 | | - "(1, [9, 3], 4)\n" |
219 | | - ] |
220 | | - } |
221 | | - ], |
| 125 | + "outputs": [], |
222 | 126 | "source": [ |
223 | 127 | "t = (1, [2, 3], 4)\n", |
224 | 128 | "t[1][0] = 9\n", |
|
227 | 131 | }, |
228 | 132 | { |
229 | 133 | "cell_type": "code", |
230 | | - "execution_count": 49, |
| 134 | + "execution_count": null, |
231 | 135 | "metadata": {}, |
232 | | - "outputs": [ |
233 | | - { |
234 | | - "name": "stdout", |
235 | | - "output_type": "stream", |
236 | | - "text": [ |
237 | | - "1\n" |
238 | | - ] |
239 | | - } |
240 | | - ], |
| 136 | + "outputs": [], |
241 | 137 | "source": [ |
242 | 138 | "my_dict = {'a': 1, 'b': 2}\n", |
243 | 139 | "print(my_dict['a'])" |
244 | 140 | ] |
245 | 141 | }, |
246 | 142 | { |
247 | 143 | "cell_type": "code", |
248 | | - "execution_count": 50, |
| 144 | + "execution_count": null, |
249 | 145 | "metadata": {}, |
250 | | - "outputs": [ |
251 | | - { |
252 | | - "name": "stdout", |
253 | | - "output_type": "stream", |
254 | | - "text": [ |
255 | | - "{'x': 10, 'y': 20, 'z': 30}\n" |
256 | | - ] |
257 | | - } |
258 | | - ], |
| 146 | + "outputs": [], |
259 | 147 | "source": [ |
260 | 148 | "d = {'x': 10, 'y': 20}\n", |
261 | 149 | "d['z']=30\n", |
|
264 | 152 | }, |
265 | 153 | { |
266 | 154 | "cell_type": "code", |
267 | | - "execution_count": 51, |
| 155 | + "execution_count": null, |
268 | 156 | "metadata": {}, |
269 | | - "outputs": [ |
270 | | - { |
271 | | - "name": "stdout", |
272 | | - "output_type": "stream", |
273 | | - "text": [ |
274 | | - "{1, 2, 3}\n" |
275 | | - ] |
276 | | - } |
277 | | - ], |
| 157 | + "outputs": [], |
278 | 158 | "source": [ |
279 | 159 | "my_set = {1, 2, 2, 3}\n", |
280 | 160 | "print(my_set)" |
281 | 161 | ] |
282 | 162 | }, |
283 | 163 | { |
284 | 164 | "cell_type": "code", |
285 | | - "execution_count": 53, |
| 165 | + "execution_count": null, |
286 | 166 | "metadata": {}, |
287 | | - "outputs": [ |
288 | | - { |
289 | | - "name": "stdout", |
290 | | - "output_type": "stream", |
291 | | - "text": [ |
292 | | - "{1, 2, 3, 4, 5}\n" |
293 | | - ] |
294 | | - } |
295 | | - ], |
| 167 | + "outputs": [], |
296 | 168 | "source": [ |
297 | 169 | "s1 = {1, 2, 3}\n", |
298 | 170 | "s2 = {3, 4, 5}\n", |
|
302 | 174 | }, |
303 | 175 | { |
304 | 176 | "cell_type": "code", |
305 | | - "execution_count": 54, |
| 177 | + "execution_count": null, |
306 | 178 | "metadata": {}, |
307 | | - "outputs": [ |
308 | | - { |
309 | | - "name": "stdout", |
310 | | - "output_type": "stream", |
311 | | - "text": [ |
312 | | - "<class 'float'>\n" |
313 | | - ] |
314 | | - } |
315 | | - ], |
| 179 | + "outputs": [], |
316 | 180 | "source": [ |
317 | 181 | "x = 5\n", |
318 | 182 | "y = 2.5\n", |
|
322 | 186 | }, |
323 | 187 | { |
324 | 188 | "cell_type": "code", |
325 | | - "execution_count": 55, |
| 189 | + "execution_count": null, |
326 | 190 | "metadata": {}, |
327 | | - "outputs": [ |
328 | | - { |
329 | | - "name": "stdout", |
330 | | - "output_type": "stream", |
331 | | - "text": [ |
332 | | - "[1, 2, 3, 4, 5, 6]\n" |
333 | | - ] |
334 | | - } |
335 | | - ], |
| 191 | + "outputs": [], |
336 | 192 | "source": [ |
337 | 193 | "a = [1, 2, 3]\n", |
338 | 194 | "b = (4, 5, 6)\n", |
|
342 | 198 | }, |
343 | 199 | { |
344 | 200 | "cell_type": "code", |
345 | | - "execution_count": 56, |
| 201 | + "execution_count": null, |
346 | 202 | "metadata": {}, |
347 | | - "outputs": [ |
348 | | - { |
349 | | - "name": "stdout", |
350 | | - "output_type": "stream", |
351 | | - "text": [ |
352 | | - "{'a': [1, 2, 3], 'b': (3, 4)}\n" |
353 | | - ] |
354 | | - } |
355 | | - ], |
| 203 | + "outputs": [], |
356 | 204 | "source": [ |
357 | 205 | "my_dict = {'a': [1, 2], 'b': (3, 4)}\n", |
358 | 206 | "my_dict['a'].append(3)\n", |
|
361 | 209 | }, |
362 | 210 | { |
363 | 211 | "cell_type": "code", |
364 | | - "execution_count": 59, |
| 212 | + "execution_count": null, |
365 | 213 | "metadata": {}, |
366 | | - "outputs": [ |
367 | | - { |
368 | | - "name": "stdout", |
369 | | - "output_type": "stream", |
370 | | - "text": [ |
371 | | - "{'4', 1, 2, 3}\n" |
372 | | - ] |
373 | | - } |
374 | | - ], |
| 214 | + "outputs": [], |
375 | 215 | "source": [ |
376 | 216 | "s = {1, 2, 3}\n", |
377 | 217 | "s.add('4')\n", |
|
0 commit comments