Skip to content

Commit 1193315

Browse files
rm a md cell
1 parent 720fe04 commit 1193315

File tree

1 file changed

+12
-84
lines changed

1 file changed

+12
-84
lines changed

CMP9065 Data Programming in Python/lectures/Lecture 2 - IO, Formatting, and Flow Control.ipynb

+12-84
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,14 @@
104104
"metadata": {},
105105
"outputs": [],
106106
"source": [
107-
"num_int = 581\n",
108-
"num_float = 213.23458\n",
107+
"num_int = 580\n",
108+
"num_int_2 = 2\n",
109+
"print(type(num_int), type(num_int_2))\n",
109110
"\n",
110-
"num_result = num_int + num_float\n",
111-
"type(num_result)"
111+
"num_result = num_int / num_int_2\n",
112+
"print(type(num_result), num_result)\n",
113+
"\n",
114+
"print(type(not -1.22))"
112115
]
113116
},
114117
{
@@ -213,14 +216,6 @@
213216
" print(file_obj.read())"
214217
]
215218
},
216-
{
217-
"cell_type": "markdown",
218-
"id": "795edfa8-bd6d-4b45-9605-ac33523c9bf7",
219-
"metadata": {},
220-
"source": [
221-
"Also notice that in the above code cell, we used a for loop! More on that shortly."
222-
]
223-
},
224219
{
225220
"cell_type": "markdown",
226221
"id": "54f2ea55-e386-42be-884a-d596b545de72",
@@ -275,64 +270,10 @@
275270
},
276271
{
277272
"cell_type": "code",
278-
"execution_count": 12,
273+
"execution_count": null,
279274
"id": "8d8db9a6-3a10-4661-99b3-5ccfeaeb6205",
280275
"metadata": {},
281-
"outputs": [
282-
{
283-
"name": "stdout",
284-
"output_type": "stream",
285-
"text": [
286-
"1\n",
287-
"2\n",
288-
"3\n",
289-
"4\n",
290-
"5\n",
291-
"1\n",
292-
"2\n",
293-
"3\n",
294-
"4\n",
295-
"5\n",
296-
"apple\n",
297-
"banana\n",
298-
"watermelon\n",
299-
"0.4\n",
300-
"0.35\n",
301-
"2.0\n",
302-
"apple\n",
303-
"banana\n",
304-
"watermelon\n",
305-
"milk\n",
306-
"cream\n",
307-
"butter\n",
308-
"salut\n",
309-
"\n",
310-
"hola\n",
311-
"\n",
312-
"privet\n",
313-
"\n",
314-
"ni hao\n",
315-
"\n",
316-
"ciao\n",
317-
"\n",
318-
"hallo\n",
319-
"\n",
320-
"oi\n",
321-
"\n",
322-
"hej\n",
323-
"\n",
324-
"czesc\n",
325-
"\n",
326-
"selam\n",
327-
"\n",
328-
"heimerhaba\n",
329-
"\n",
330-
"namaste\n",
331-
"\n",
332-
"new greeting\n"
333-
]
334-
}
335-
],
276+
"outputs": [],
336277
"source": [
337278
"# create a collection (in this case, list)\n",
338279
"vals = [1, 2, 3, 4, 5]\n",
@@ -365,7 +306,7 @@
365306
"# we can also loop a file object lines\n",
366307
"with open('greetings.txt', 'r') as greetings:\n",
367308
" for greeting in greetings:\n",
368-
" print(greeting)"
309+
" print(greeting, end='')"
369310
]
370311
},
371312
{
@@ -380,23 +321,10 @@
380321
},
381322
{
382323
"cell_type": "code",
383-
"execution_count": 11,
324+
"execution_count": null,
384325
"id": "81721b6a-e58d-4176-a4a9-66f01806a53c",
385326
"metadata": {},
386-
"outputs": [
387-
{
388-
"name": "stdout",
389-
"output_type": "stream",
390-
"text": [
391-
"1\n",
392-
"2\n",
393-
"3\n",
394-
"4\n",
395-
"5\n",
396-
"['salut\\n', 'hola\\n', 'privet\\n', 'ni hao\\n', 'ciao\\n', 'hallo\\n', 'oi\\n', 'hej\\n', 'czesc\\n', 'selam\\n', 'heimerhaba\\n', 'namaste\\n', 'new greeting']\n"
397-
]
398-
}
399-
],
327+
"outputs": [],
400328
"source": [
401329
"# create a collection (in this case, list)\n",
402330
"vals = [1, 2, 3, 4, 5]\n",

0 commit comments

Comments
 (0)