Skip to content

Commit 818b57a

Browse files
committed
Minor notebook tweaks
1 parent 3f4309e commit 818b57a

File tree

4 files changed

+348
-14
lines changed

4 files changed

+348
-14
lines changed

exercise_files/.ipynb_checkpoints/02_01_Basic_Data_Types-checkpoint.ipynb

+336-11
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,112 @@
2828
},
2929
{
3030
"cell_type": "code",
31-
"execution_count": null,
32-
"id": "be956386",
31+
"execution_count": 2,
32+
"id": "e33dd9d1",
33+
"metadata": {},
34+
"outputs": [
35+
{
36+
"name": "stdout",
37+
"output_type": "stream",
38+
"text": [
39+
"5\n"
40+
]
41+
}
42+
],
43+
"source": [
44+
"print(x)"
45+
]
46+
},
47+
{
48+
"cell_type": "code",
49+
"execution_count": 3,
50+
"id": "396bd3c1",
51+
"metadata": {},
52+
"outputs": [
53+
{
54+
"data": {
55+
"text/plain": [
56+
"5"
57+
]
58+
},
59+
"execution_count": 3,
60+
"metadata": {},
61+
"output_type": "execute_result"
62+
}
63+
],
64+
"source": [
65+
"x"
66+
]
67+
},
68+
{
69+
"cell_type": "code",
70+
"execution_count": 5,
71+
"id": "e26b25dc",
72+
"metadata": {},
73+
"outputs": [
74+
{
75+
"ename": "SyntaxError",
76+
"evalue": "invalid decimal literal (1973045331.py, line 1)",
77+
"output_type": "error",
78+
"traceback": [
79+
"\u001b[0;36m Input \u001b[0;32mIn [5]\u001b[0;36m\u001b[0m\n\u001b[0;31m 1x\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid decimal literal\n"
80+
]
81+
}
82+
],
83+
"source": [
84+
"1x"
85+
]
86+
},
87+
{
88+
"cell_type": "code",
89+
"execution_count": 6,
90+
"id": "d045d01a",
3391
"metadata": {},
3492
"outputs": [],
3593
"source": [
36-
"print"
94+
"name = 'Ryan'"
95+
]
96+
},
97+
{
98+
"cell_type": "code",
99+
"execution_count": 7,
100+
"id": "eac35943",
101+
"metadata": {},
102+
"outputs": [
103+
{
104+
"data": {
105+
"text/plain": [
106+
"str"
107+
]
108+
},
109+
"execution_count": 7,
110+
"metadata": {},
111+
"output_type": "execute_result"
112+
}
113+
],
114+
"source": [
115+
"type(name)"
116+
]
117+
},
118+
{
119+
"cell_type": "code",
120+
"execution_count": 8,
121+
"id": "1a93aa83",
122+
"metadata": {},
123+
"outputs": [
124+
{
125+
"data": {
126+
"text/plain": [
127+
"int"
128+
]
129+
},
130+
"execution_count": 8,
131+
"metadata": {},
132+
"output_type": "execute_result"
133+
}
134+
],
135+
"source": [
136+
"type(x)"
37137
]
38138
},
39139
{
@@ -46,11 +146,86 @@
46146
},
47147
{
48148
"cell_type": "code",
49-
"execution_count": null,
149+
"execution_count": 9,
50150
"id": "66b59611",
51151
"metadata": {},
152+
"outputs": [
153+
{
154+
"data": {
155+
"text/plain": [
156+
"float"
157+
]
158+
},
159+
"execution_count": 9,
160+
"metadata": {},
161+
"output_type": "execute_result"
162+
}
163+
],
164+
"source": [
165+
"type(1.5)"
166+
]
167+
},
168+
{
169+
"cell_type": "code",
170+
"execution_count": null,
171+
"id": "260be4ae",
172+
"metadata": {},
52173
"outputs": [],
53-
"source": []
174+
"source": [
175+
"1.23456789"
176+
]
177+
},
178+
{
179+
"cell_type": "code",
180+
"execution_count": null,
181+
"id": "b0c62fcc",
182+
"metadata": {},
183+
"outputs": [],
184+
"source": [
185+
"12345678.9"
186+
]
187+
},
188+
{
189+
"cell_type": "code",
190+
"execution_count": 10,
191+
"id": "b57e9f24",
192+
"metadata": {},
193+
"outputs": [
194+
{
195+
"data": {
196+
"text/plain": [
197+
"complex"
198+
]
199+
},
200+
"execution_count": 10,
201+
"metadata": {},
202+
"output_type": "execute_result"
203+
}
204+
],
205+
"source": [
206+
"type(2j)"
207+
]
208+
},
209+
{
210+
"cell_type": "code",
211+
"execution_count": 11,
212+
"id": "70f204ce",
213+
"metadata": {},
214+
"outputs": [
215+
{
216+
"data": {
217+
"text/plain": [
218+
"(-1+0j)"
219+
]
220+
},
221+
"execution_count": 11,
222+
"metadata": {},
223+
"output_type": "execute_result"
224+
}
225+
],
226+
"source": [
227+
"1j * 1j"
228+
]
54229
},
55230
{
56231
"cell_type": "markdown",
@@ -62,11 +237,67 @@
62237
},
63238
{
64239
"cell_type": "code",
65-
"execution_count": null,
66-
"id": "28869023",
240+
"execution_count": 12,
241+
"id": "4b72f826",
67242
"metadata": {},
68-
"outputs": [],
69-
"source": []
243+
"outputs": [
244+
{
245+
"data": {
246+
"text/plain": [
247+
"'String 1 String 2'"
248+
]
249+
},
250+
"execution_count": 12,
251+
"metadata": {},
252+
"output_type": "execute_result"
253+
}
254+
],
255+
"source": [
256+
"'String 1 ' + 'String 2'"
257+
]
258+
},
259+
{
260+
"cell_type": "code",
261+
"execution_count": 13,
262+
"id": "14c2ced2",
263+
"metadata": {},
264+
"outputs": [
265+
{
266+
"data": {
267+
"text/plain": [
268+
"'11'"
269+
]
270+
},
271+
"execution_count": 13,
272+
"metadata": {},
273+
"output_type": "execute_result"
274+
}
275+
],
276+
"source": [
277+
"'1' + '1'"
278+
]
279+
},
280+
{
281+
"cell_type": "code",
282+
"execution_count": 14,
283+
"id": "1b327896",
284+
"metadata": {},
285+
"outputs": [
286+
{
287+
"ename": "TypeError",
288+
"evalue": "can only concatenate str (not \"int\") to str",
289+
"output_type": "error",
290+
"traceback": [
291+
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
292+
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
293+
"Input \u001b[0;32mIn [14]\u001b[0m, in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m1\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;241;43m+\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;241;43m1\u001b[39;49m\n",
294+
"\u001b[0;31mTypeError\u001b[0m: can only concatenate str (not \"int\") to str"
295+
]
296+
}
297+
],
298+
"source": [
299+
"'1' + 1"
300+
]
70301
},
71302
{
72303
"cell_type": "markdown",
@@ -78,9 +309,103 @@
78309
},
79310
{
80311
"cell_type": "code",
81-
"execution_count": null,
312+
"execution_count": 15,
82313
"id": "a3d9b9bc",
83314
"metadata": {},
315+
"outputs": [
316+
{
317+
"data": {
318+
"text/plain": [
319+
"True"
320+
]
321+
},
322+
"execution_count": 15,
323+
"metadata": {},
324+
"output_type": "execute_result"
325+
}
326+
],
327+
"source": [
328+
"True"
329+
]
330+
},
331+
{
332+
"cell_type": "code",
333+
"execution_count": 16,
334+
"id": "a8379a41",
335+
"metadata": {},
336+
"outputs": [
337+
{
338+
"data": {
339+
"text/plain": [
340+
"False"
341+
]
342+
},
343+
"execution_count": 16,
344+
"metadata": {},
345+
"output_type": "execute_result"
346+
}
347+
],
348+
"source": [
349+
"False"
350+
]
351+
},
352+
{
353+
"cell_type": "code",
354+
"execution_count": 18,
355+
"id": "e3c34286",
356+
"metadata": {},
357+
"outputs": [],
358+
"source": [
359+
"true = True"
360+
]
361+
},
362+
{
363+
"cell_type": "code",
364+
"execution_count": 19,
365+
"id": "85d586ae",
366+
"metadata": {},
367+
"outputs": [
368+
{
369+
"data": {
370+
"text/plain": [
371+
"True"
372+
]
373+
},
374+
"execution_count": 19,
375+
"metadata": {},
376+
"output_type": "execute_result"
377+
}
378+
],
379+
"source": [
380+
"1 == 1"
381+
]
382+
},
383+
{
384+
"cell_type": "code",
385+
"execution_count": 20,
386+
"id": "4992ca39",
387+
"metadata": {},
388+
"outputs": [
389+
{
390+
"data": {
391+
"text/plain": [
392+
"False"
393+
]
394+
},
395+
"execution_count": 20,
396+
"metadata": {},
397+
"output_type": "execute_result"
398+
}
399+
],
400+
"source": [
401+
"1 == 2"
402+
]
403+
},
404+
{
405+
"cell_type": "code",
406+
"execution_count": null,
407+
"id": "bde64579",
408+
"metadata": {},
84409
"outputs": [],
85410
"source": []
86411
}
@@ -101,7 +426,7 @@
101426
"name": "python",
102427
"nbconvert_exporter": "python",
103428
"pygments_lexer": "ipython3",
104-
"version": "3.10.2"
429+
"version": "3.10.4"
105430
}
106431
},
107432
"nbformat": 4,

exercise_files/02_01_Basic_Data_Types.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@
426426
"name": "python",
427427
"nbconvert_exporter": "python",
428428
"pygments_lexer": "ipython3",
429-
"version": "3.10.2"
429+
"version": "3.10.4"
430430
}
431431
},
432432
"nbformat": 4,

0 commit comments

Comments
 (0)