Skip to content

Commit a201f72

Browse files
author
Daniel Greenfeld
committed
Merge branch 'master' of github.com:pythonsd/intro-to-python
2 parents e4903c9 + c9f0866 commit a201f72

File tree

3 files changed

+43
-172
lines changed

3 files changed

+43
-172
lines changed

part-1.ipynb

Lines changed: 13 additions & 155 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"name": "python2"
1111
},
1212
"name": "",
13-
"signature": "sha256:3d8e168c53b333482ede8c41b34f62222e7a07d410c6665c60f32285923930fa"
13+
"signature": "sha256:0f359e9c97dbdab0051d127b9eec4d41334bcbfbb69469d54cd2d85bfab89255"
1414
},
1515
"nbformat": 3,
1616
"nbformat_minor": 0,
@@ -239,17 +239,7 @@
239239
],
240240
"language": "python",
241241
"metadata": {},
242-
"outputs": [
243-
{
244-
"metadata": {},
245-
"output_type": "pyout",
246-
"prompt_number": 10,
247-
"text": [
248-
"2"
249-
]
250-
}
251-
],
252-
"prompt_number": 10
242+
"outputs": []
253243
},
254244
{
255245
"cell_type": "code",
@@ -259,17 +249,7 @@
259249
],
260250
"language": "python",
261251
"metadata": {},
262-
"outputs": [
263-
{
264-
"metadata": {},
265-
"output_type": "pyout",
266-
"prompt_number": 11,
267-
"text": [
268-
"0"
269-
]
270-
}
271-
],
272-
"prompt_number": 11
252+
"outputs": []
273253
},
274254
{
275255
"cell_type": "markdown",
@@ -286,17 +266,7 @@
286266
],
287267
"language": "python",
288268
"metadata": {},
289-
"outputs": [
290-
{
291-
"metadata": {},
292-
"output_type": "pyout",
293-
"prompt_number": 12,
294-
"text": [
295-
"1"
296-
]
297-
}
298-
],
299-
"prompt_number": 12
269+
"outputs": []
300270
},
301271
{
302272
"cell_type": "code",
@@ -306,17 +276,7 @@
306276
],
307277
"language": "python",
308278
"metadata": {},
309-
"outputs": [
310-
{
311-
"metadata": {},
312-
"output_type": "pyout",
313-
"prompt_number": 20,
314-
"text": [
315-
"7"
316-
]
317-
}
318-
],
319-
"prompt_number": 20
279+
"outputs": []
320280
},
321281
{
322282
"cell_type": "code",
@@ -326,17 +286,7 @@
326286
],
327287
"language": "python",
328288
"metadata": {},
329-
"outputs": [
330-
{
331-
"metadata": {},
332-
"output_type": "pyout",
333-
"prompt_number": 2,
334-
"text": [
335-
"0.5"
336-
]
337-
}
338-
],
339-
"prompt_number": 2
289+
"outputs": []
340290
},
341291
{
342292
"cell_type": "code",
@@ -346,17 +296,7 @@
346296
],
347297
"language": "python",
348298
"metadata": {},
349-
"outputs": [
350-
{
351-
"metadata": {},
352-
"output_type": "pyout",
353-
"prompt_number": 3,
354-
"text": [
355-
"4"
356-
]
357-
}
358-
],
359-
"prompt_number": 3
299+
"outputs": []
360300
},
361301
{
362302
"cell_type": "code",
@@ -433,17 +373,7 @@
433373
],
434374
"language": "python",
435375
"metadata": {},
436-
"outputs": [
437-
{
438-
"metadata": {},
439-
"output_type": "pyout",
440-
"prompt_number": 6,
441-
"text": [
442-
"0"
443-
]
444-
}
445-
],
446-
"prompt_number": 6
376+
"outputs": []
447377
},
448378
{
449379
"cell_type": "code",
@@ -453,17 +383,7 @@
453383
],
454384
"language": "python",
455385
"metadata": {},
456-
"outputs": [
457-
{
458-
"metadata": {},
459-
"output_type": "pyout",
460-
"prompt_number": 7,
461-
"text": [
462-
"0.5"
463-
]
464-
}
465-
],
466-
"prompt_number": 7
386+
"outputs": []
467387
},
468388
{
469389
"cell_type": "markdown",
@@ -483,17 +403,7 @@
483403
],
484404
"language": "python",
485405
"metadata": {},
486-
"outputs": [
487-
{
488-
"metadata": {},
489-
"output_type": "pyout",
490-
"prompt_number": 8,
491-
"text": [
492-
"int"
493-
]
494-
}
495-
],
496-
"prompt_number": 8
406+
"outputs": []
497407
},
498408
{
499409
"cell_type": "code",
@@ -503,17 +413,7 @@
503413
],
504414
"language": "python",
505415
"metadata": {},
506-
"outputs": [
507-
{
508-
"metadata": {},
509-
"output_type": "pyout",
510-
"prompt_number": 9,
511-
"text": [
512-
"float"
513-
]
514-
}
515-
],
516-
"prompt_number": 9
416+
"outputs": []
517417
},
518418
{
519419
"cell_type": "markdown",
@@ -1257,28 +1157,7 @@
12571157
],
12581158
"language": "python",
12591159
"metadata": {},
1260-
"outputs": [
1261-
{
1262-
"html": [
1263-
"\n",
1264-
" <iframe\n",
1265-
" width=\"400\"\n",
1266-
" height=300\"\n",
1267-
" src=\"https://www.youtube.com/embed/MirG-vJOg04\"\n",
1268-
" frameborder=\"0\"\n",
1269-
" allowfullscreen\n",
1270-
" ></iframe>\n",
1271-
" "
1272-
],
1273-
"metadata": {},
1274-
"output_type": "pyout",
1275-
"prompt_number": 4,
1276-
"text": [
1277-
"<IPython.lib.display.YouTubeVideo at 0x1037dd290>"
1278-
]
1279-
}
1280-
],
1281-
"prompt_number": 4
1160+
"outputs": []
12821161
},
12831162
{
12841163
"cell_type": "code",
@@ -1290,28 +1169,7 @@
12901169
],
12911170
"language": "python",
12921171
"metadata": {},
1293-
"outputs": [
1294-
{
1295-
"html": [
1296-
"\n",
1297-
" <iframe\n",
1298-
" width=\"100%\"\n",
1299-
" height=350\"\n",
1300-
" src=\"http://bit.ly/intro-setup\"\n",
1301-
" frameborder=\"0\"\n",
1302-
" allowfullscreen\n",
1303-
" ></iframe>\n",
1304-
" "
1305-
],
1306-
"metadata": {},
1307-
"output_type": "pyout",
1308-
"prompt_number": 6,
1309-
"text": [
1310-
"<IPython.lib.display.IFrame at 0x1037e6150>"
1311-
]
1312-
}
1313-
],
1314-
"prompt_number": 6
1172+
"outputs": []
13151173
},
13161174
{
13171175
"cell_type": "code",

part-2.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"metadata": {
33
"name": "",
4-
"signature": "sha256:5971437139d68c28dfdde7b4fac2d183a47d23785ca8f68a14440bd8846a44e4"
4+
"signature": "sha256:7640407737f0f1e8519c9b988e071dc2978364eabd3531de7ede1919a57b3780"
55
},
66
"nbformat": 3,
77
"nbformat_minor": 0,
@@ -561,14 +561,14 @@
561561
"cell_type": "markdown",
562562
"metadata": {},
563563
"source": [
564-
"Now let's replace wedding ring with tungston weddding ring"
564+
"Now let's replace wedding ring with tungsten wedding ring"
565565
]
566566
},
567567
{
568568
"cell_type": "code",
569569
"collapsed": false,
570570
"input": [
571-
"stuff[2] = \"tungston wedding ring\""
571+
"stuff[2] = \"tungsten wedding ring\""
572572
],
573573
"language": "python",
574574
"metadata": {},
@@ -586,7 +586,7 @@
586586
"cell_type": "code",
587587
"collapsed": false,
588588
"input": [
589-
"stuff[2] == \"tungston wedding ring\""
589+
"stuff[2] == \"tungsten wedding ring\""
590590
],
591591
"language": "python",
592592
"metadata": {},
@@ -677,7 +677,7 @@
677677
"output_type": "pyout",
678678
"prompt_number": 41,
679679
"text": [
680-
"'tungston wedding ring'"
680+
"'tungsten wedding ring'"
681681
]
682682
}
683683
],
@@ -706,7 +706,7 @@
706706
"output_type": "pyout",
707707
"prompt_number": 42,
708708
"text": [
709-
"'tungston wedding ring'"
709+
"'tungsten wedding ring'"
710710
]
711711
}
712712
],
@@ -1985,4 +1985,4 @@
19851985
"metadata": {}
19861986
}
19871987
]
1988-
}
1988+
}

part-4.ipynb

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"metadata": {
33
"name": "",
4-
"signature": "sha256:826b0e4b3d39f844b868b8370fcaac110d06dbe6afb167b149a60d16aea5592e"
4+
"signature": "sha256:40f96dd4a9a68767b80bf16809c2b3aebd08f6893eb2d01994fd18e611864f26"
55
},
66
"nbformat": 3,
77
"nbformat_minor": 0,
@@ -396,7 +396,28 @@
396396
"cell_type": "markdown",
397397
"metadata": {},
398398
"source": [
399-
"**Extra Credit:** Try using a list comprehension in the translate function."
399+
"It's also possible to loop through the keys and values of a dictionary using the items method.\n",
400+
"Let's loop through the words dictionary and see how this works:"
401+
]
402+
},
403+
{
404+
"cell_type": "code",
405+
"collapsed": false,
406+
"input": [
407+
"for key, value in words.items():\n",
408+
" print(key, value)"
409+
],
410+
"language": "python",
411+
"metadata": {},
412+
"outputs": []
413+
},
414+
{
415+
"cell_type": "markdown",
416+
"metadata": {},
417+
"source": [
418+
"**Extra Credit:** Try using a list comprehension in the translate function.\n",
419+
"\n",
420+
"**Note:** Typing out the exercises for the next section, \"Sets\", is optional. If your brain is melting, feel free to sit back, relax, and enjoy the rest of the lecture."
400421
]
401422
},
402423
{
@@ -554,14 +575,6 @@
554575
"language": "python",
555576
"metadata": {},
556577
"outputs": []
557-
},
558-
{
559-
"cell_type": "code",
560-
"collapsed": false,
561-
"input": [],
562-
"language": "python",
563-
"metadata": {},
564-
"outputs": []
565578
}
566579
],
567580
"metadata": {}

0 commit comments

Comments
 (0)