Skip to content

Commit 860ebe8

Browse files
committed
Merge pull request #37 from willingc/part1-edits
Merges a number of Part 1 edits
2 parents fd67ef4 + 18cab85 commit 860ebe8

File tree

2 files changed

+191
-35
lines changed

2 files changed

+191
-35
lines changed

part-1.ipynb

+113-29
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"name": "python2"
1111
},
1212
"name": "",
13-
"signature": "sha256:0f359e9c97dbdab0051d127b9eec4d41334bcbfbb69469d54cd2d85bfab89255"
13+
"signature": "sha256:5b78afa85dd8d13ddacbd2795e2e59031426989539554cff55ee4238d13cbf87"
1414
},
1515
"nbformat": 3,
1616
"nbformat_minor": 0,
@@ -52,11 +52,13 @@
5252
"cell_type": "markdown",
5353
"metadata": {},
5454
"source": [
55-
"A programming community outreach workshop, brought to you by the generous volunteers from:\n",
55+
"A programming community outreach workshop, brought to you by the generous volunteers and leadership from:\n",
5656
"\n",
5757
"- [PyLadies San Diego](www.meetup.com/sd-pyladies/)\n",
5858
"- [San Diego Python User Group](www.meetup.com/pythonsd/)\n",
59-
"- [Inland Empire Pyladies](www.meetup.com/iepyladies/)"
59+
"- [Inland Empire Pyladies](www.meetup.com/iepyladies/)\n",
60+
"\n",
61+
"Thanks to David and Kendall of SDPUG and Juliet of PyLadies SD for their support."
6062
]
6163
},
6264
{
@@ -68,11 +70,13 @@
6870
"- Danny\n",
6971
"- Rise\n",
7072
"- Trey\n",
73+
"- Alain\n",
74+
"- Micah\n",
7175
"- Jim\n",
7276
"- Others that are helping on day of event\n",
7377
"- Carol\n",
7478
"\n",
75-
"Please take a moment to share 2-4 sentences about yourself\n",
79+
"Please take a moment to share 2-4 sentences about yourself.\n",
7680
"\n",
7781
"We are all volunteers. If you enjoy this workshop and decide to continue with Python programming, we encourage you to volunteer at the next Intro to Python Workshop.\n",
7882
"\n",
@@ -184,11 +188,21 @@
184188
"Let's get started with the interactive lecture"
185189
]
186190
},
191+
{
192+
"cell_type": "heading",
193+
"level": 3,
194+
"metadata": {},
195+
"source": [
196+
"Python as a Calculator"
197+
]
198+
},
187199
{
188200
"cell_type": "markdown",
189201
"metadata": {},
190202
"source": [
191-
"Terminal and start python"
203+
"From your command prompt, type `python3` to enter IDLE.\n",
204+
"\n",
205+
"Some regular math operations."
192206
]
193207
},
194208
{
@@ -245,7 +259,7 @@
245259
"cell_type": "code",
246260
"collapsed": false,
247261
"input": [
248-
"1 / 2"
262+
"0.5/2"
249263
],
250264
"language": "python",
251265
"metadata": {},
@@ -255,14 +269,14 @@
255269
"cell_type": "markdown",
256270
"metadata": {},
257271
"source": [
258-
"Whole number 1 divided by whole number 2"
272+
"**Special type of division (floor)**"
259273
]
260274
},
261275
{
262276
"cell_type": "code",
263277
"collapsed": false,
264278
"input": [
265-
"3 / 2"
279+
"3 // 2"
266280
],
267281
"language": "python",
268282
"metadata": {},
@@ -272,17 +286,24 @@
272286
"cell_type": "code",
273287
"collapsed": false,
274288
"input": [
275-
"15 / 2"
289+
"15.5 // 2"
276290
],
277291
"language": "python",
278292
"metadata": {},
279293
"outputs": []
280294
},
295+
{
296+
"cell_type": "markdown",
297+
"metadata": {},
298+
"source": [
299+
"Horizontal line spacing does not matter in Python in an individual statement. In a multiline program it does, you typically indent 4 spaces."
300+
]
301+
},
281302
{
282303
"cell_type": "code",
283304
"collapsed": false,
284305
"input": [
285-
"1.0 / 2"
306+
"2 + 2"
286307
],
287308
"language": "python",
288309
"metadata": {},
@@ -292,17 +313,24 @@
292313
"cell_type": "code",
293314
"collapsed": false,
294315
"input": [
295-
"2 + 2"
316+
"2+2"
296317
],
297318
"language": "python",
298319
"metadata": {},
299320
"outputs": []
300321
},
322+
{
323+
"cell_type": "markdown",
324+
"metadata": {},
325+
"source": [
326+
"Parens and order of operations follow typical mathematics conventions in Python. `_` in IPython signifies the previous result."
327+
]
328+
},
301329
{
302330
"cell_type": "code",
303331
"collapsed": false,
304332
"input": [
305-
"2+2"
333+
"(1 + 3) * 4"
306334
],
307335
"language": "python",
308336
"metadata": {},
@@ -312,7 +340,7 @@
312340
"cell_type": "code",
313341
"collapsed": false,
314342
"input": [
315-
"(1 + 3) * 4"
343+
"x = 4"
316344
],
317345
"language": "python",
318346
"metadata": {},
@@ -322,7 +350,7 @@
322350
"cell_type": "code",
323351
"collapsed": false,
324352
"input": [
325-
"x = 4"
353+
"x * 3"
326354
],
327355
"language": "python",
328356
"metadata": {},
@@ -332,7 +360,7 @@
332360
"cell_type": "code",
333361
"collapsed": false,
334362
"input": [
335-
"x * 3"
363+
"_ + 8"
336364
],
337365
"language": "python",
338366
"metadata": {},
@@ -342,14 +370,34 @@
342370
"cell_type": "markdown",
343371
"metadata": {},
344372
"source": [
345-
"Variables"
373+
"**A trip to PyCon**"
346374
]
347375
},
348376
{
349377
"cell_type": "code",
350378
"collapsed": false,
351379
"input": [
352-
"cups_of_flour = 5"
380+
"jeans = 5"
381+
],
382+
"language": "python",
383+
"metadata": {},
384+
"outputs": []
385+
},
386+
{
387+
"cell_type": "code",
388+
"collapsed": false,
389+
"input": [
390+
"shoes = 2"
391+
],
392+
"language": "python",
393+
"metadata": {},
394+
"outputs": []
395+
},
396+
{
397+
"cell_type": "code",
398+
"collapsed": false,
399+
"input": [
400+
"socks = 12"
353401
],
354402
"language": "python",
355403
"metadata": {},
@@ -359,7 +407,7 @@
359407
"cell_type": "code",
360408
"collapsed": false,
361409
"input": [
362-
"cups_of_flour * .5"
410+
"shirts = 1"
363411
],
364412
"language": "python",
365413
"metadata": {},
@@ -369,7 +417,7 @@
369417
"cell_type": "code",
370418
"collapsed": false,
371419
"input": [
372-
"1 / 2\n"
420+
"items_packed = jeans + shoes + socks + shirts"
373421
],
374422
"language": "python",
375423
"metadata": {},
@@ -379,7 +427,17 @@
379427
"cell_type": "code",
380428
"collapsed": false,
381429
"input": [
382-
"1.0 / 2"
430+
"items_packed"
431+
],
432+
"language": "python",
433+
"metadata": {},
434+
"outputs": []
435+
},
436+
{
437+
"cell_type": "code",
438+
"collapsed": false,
439+
"input": [
440+
"print(items_packed)"
383441
],
384442
"language": "python",
385443
"metadata": {},
@@ -389,17 +447,19 @@
389447
"cell_type": "markdown",
390448
"metadata": {},
391449
"source": [
392-
"Two different data types\n",
450+
"**Using type() to find the datatype**\n",
393451
"\n",
394452
"\n",
395-
"Let's use a function"
453+
"Let's use a function. You'll be hearing more about functions later today. For now let's say that a function is like a Personal Assistant. You ask for a job to be done, and if you give the assistant the correct instructions, he will do the tasks asked.\n",
454+
"\n",
455+
"One handy thing that our Python Personal Assistant, aka Funky Function, can do is tell us a variable's current data type."
396456
]
397457
},
398458
{
399459
"cell_type": "code",
400460
"collapsed": false,
401461
"input": [
402-
"type(1)"
462+
"type(shirts)"
403463
],
404464
"language": "python",
405465
"metadata": {},
@@ -409,7 +469,7 @@
409469
"cell_type": "code",
410470
"collapsed": false,
411471
"input": [
412-
"type(1.0)"
472+
"type(0.99)"
413473
],
414474
"language": "python",
415475
"metadata": {},
@@ -426,7 +486,7 @@
426486
"cell_type": "markdown",
427487
"metadata": {},
428488
"source": [
429-
"String data type"
489+
"**String data type**"
430490
]
431491
},
432492
{
@@ -459,6 +519,13 @@
459519
"metadata": {},
460520
"outputs": []
461521
},
522+
{
523+
"cell_type": "markdown",
524+
"metadata": {},
525+
"source": [
526+
"**Concatenating strings**"
527+
]
528+
},
462529
{
463530
"cell_type": "code",
464531
"collapsed": false,
@@ -493,6 +560,7 @@
493560
"cell_type": "code",
494561
"collapsed": false,
495562
"input": [
563+
"\n",
496564
"\"Carol \" + \"Willing\"\n"
497565
],
498566
"language": "python",
@@ -533,7 +601,7 @@
533601
"cell_type": "markdown",
534602
"metadata": {},
535603
"source": [
536-
"Tip - arrow up save typing"
604+
"*Tip - arrow up to save time typing*"
537605
]
538606
},
539607
{
@@ -636,6 +704,13 @@
636704
"metadata": {},
637705
"outputs": []
638706
},
707+
{
708+
"cell_type": "markdown",
709+
"metadata": {},
710+
"source": [
711+
"**Quotes (single, double, triple)**"
712+
]
713+
},
639714
{
640715
"cell_type": "code",
641716
"collapsed": false,
@@ -690,7 +765,7 @@
690765
"cell_type": "markdown",
691766
"metadata": {},
692767
"source": [
693-
"Printing - interactive vs file"
768+
"**Displaying versus printing in IPython**"
694769
]
695770
},
696771
{
@@ -717,7 +792,7 @@
717792
"cell_type": "markdown",
718793
"metadata": {},
719794
"source": [
720-
"Questions?"
795+
"Questions? Quick review"
721796
]
722797
},
723798
{
@@ -761,7 +836,8 @@
761836
"outputs": []
762837
},
763838
{
764-
"cell_type": "markdown",
839+
"cell_type": "heading",
840+
"level": 3,
765841
"metadata": {},
766842
"source": [
767843
"Make choices"
@@ -1137,6 +1213,14 @@
11371213
"metadata": {},
11381214
"outputs": []
11391215
},
1216+
{
1217+
"cell_type": "markdown",
1218+
"metadata": {},
1219+
"source": [
1220+
"**Exiting the interpreter is a good thing to know.** \n",
1221+
"To exit, type `exit()` or press CNTL-D."
1222+
]
1223+
},
11401224
{
11411225
"cell_type": "markdown",
11421226
"metadata": {},

0 commit comments

Comments
 (0)