Skip to content

Commit 718a5d5

Browse files
committed
Completing exercises
Ran demos, watched videos, completed tasks within the notebooks
1 parent e7b546f commit 718a5d5

16 files changed

Lines changed: 2532 additions & 982 deletions

Python Absolute Beginner/Module_1_Practice_2_IntroPy.ipynb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
},
2525
{
2626
"cell_type": "code",
27-
"execution_count": 2,
27+
"execution_count": 5,
2828
"metadata": {
2929
"scrolled": true
3030
},
@@ -80,17 +80,17 @@
8080
},
8181
{
8282
"cell_type": "code",
83-
"execution_count": 5,
83+
"execution_count": 2,
8484
"metadata": {},
8585
"outputs": [
8686
{
8787
"name": "stdout",
8888
"output_type": "stream",
8989
"text": [
9090
"what is the meeting subject?: History\n",
91-
"what is the meeting time?:5:30 PM\n",
91+
"what is the meeting time?:5:30\n",
9292
"Meeting Subject: History\n",
93-
"Meeting Time: 5:30 PM\n"
93+
"Meeting Time: 5:30\n"
9494
]
9595
}
9696
],
@@ -135,7 +135,7 @@
135135
},
136136
{
137137
"cell_type": "code",
138-
"execution_count": 7,
138+
"execution_count": 6,
139139
"metadata": {},
140140
"outputs": [
141141
{
@@ -153,20 +153,20 @@
153153
},
154154
{
155155
"cell_type": "code",
156-
"execution_count": 8,
156+
"execution_count": 7,
157157
"metadata": {},
158158
"outputs": [
159159
{
160160
"name": "stdout",
161161
"output_type": "stream",
162162
"text": [
163-
"Wednesday is in the middle of the week and remember to clean sink\n"
163+
"Wednesday is in the middle of the week with the meeting about History at 5:30 and remember to clean sink\n"
164164
]
165165
}
166166
],
167167
"source": [
168168
"# [ ] Combine 3 variables from above with multiple strings\n",
169-
"print(\"Wednesday is\",\"in the middle of the week\",\"and remember to\",remind_me)\n"
169+
"print(\"Wednesday is\",\"in the middle of the week with the meeting about\",meeting_subject,\"at\",meeting_time,\"and remember to\",remind_me)\n"
170170
]
171171
},
172172
{

Python Absolute Beginner/Module_3_1_Absolute_Beginner.ipynb

Lines changed: 145 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,17 @@
4444
},
4545
{
4646
"cell_type": "code",
47-
"execution_count": null,
48-
"metadata": {
49-
"collapsed": false
50-
},
51-
"outputs": [],
47+
"execution_count": 1,
48+
"metadata": {},
49+
"outputs": [
50+
{
51+
"name": "stdout",
52+
"output_type": "stream",
53+
"text": [
54+
"True means do something\n"
55+
]
56+
}
57+
],
5258
"source": [
5359
"if True:\n",
5460
" print(\"True means do something\")\n",
@@ -58,11 +64,17 @@
5864
},
5965
{
6066
"cell_type": "code",
61-
"execution_count": null,
62-
"metadata": {
63-
"collapsed": false
64-
},
65-
"outputs": [],
67+
"execution_count": 2,
68+
"metadata": {},
69+
"outputs": [
70+
{
71+
"name": "stdout",
72+
"output_type": "stream",
73+
"text": [
74+
"enjoy some hot tea!\n"
75+
]
76+
}
77+
],
6678
"source": [
6779
"hot_tea = True\n",
6880
"\n",
@@ -74,10 +86,8 @@
7486
},
7587
{
7688
"cell_type": "code",
77-
"execution_count": null,
78-
"metadata": {
79-
"collapsed": false
80-
},
89+
"execution_count": 3,
90+
"metadata": {},
8191
"outputs": [],
8292
"source": [
8393
"someone_i_know = False\n",
@@ -90,11 +100,17 @@
90100
},
91101
{
92102
"cell_type": "code",
93-
"execution_count": null,
94-
"metadata": {
95-
"collapsed": false
96-
},
97-
"outputs": [],
103+
"execution_count": 4,
104+
"metadata": {},
105+
"outputs": [
106+
{
107+
"name": "stdout",
108+
"output_type": "stream",
109+
"text": [
110+
"how have you been?\n"
111+
]
112+
}
113+
],
98114
"source": [
99115
"# changed the value of someone_i_know\n",
100116
"someone_i_know = True\n",
@@ -121,28 +137,48 @@
121137
},
122138
{
123139
"cell_type": "code",
124-
"execution_count": null,
125-
"metadata": {
126-
"collapsed": false
127-
},
128-
"outputs": [],
140+
"execution_count": 5,
141+
"metadata": {},
142+
"outputs": [
143+
{
144+
"name": "stdout",
145+
"output_type": "stream",
146+
"text": [
147+
"Go out there and seize the day!!!!!\n"
148+
]
149+
}
150+
],
129151
"source": [
130152
"sunny_today = True\n",
131153
"# [ ] test if it is sunny_today and give proper responses using if and else\n",
154+
"if sunny_today:\n",
155+
" print(\"Go out there and seize the day!!!!!\")\n",
156+
"else:\n",
157+
" print(\"Boardgames may be your best alternative.\")\n",
158+
"\n",
132159
"\n"
133160
]
134161
},
135162
{
136163
"cell_type": "code",
137-
"execution_count": null,
138-
"metadata": {
139-
"collapsed": false
140-
},
141-
"outputs": [],
164+
"execution_count": 6,
165+
"metadata": {},
166+
"outputs": [
167+
{
168+
"name": "stdout",
169+
"output_type": "stream",
170+
"text": [
171+
"Boardgames may be your best alternative.\n"
172+
]
173+
}
174+
],
142175
"source": [
143176
"sunny_today = False\n",
144177
"# [ ] use code you created above and test sunny_today = False\n",
145-
"\n"
178+
"if sunny_today:\n",
179+
" print(\"Go out there and seize the day!!!!!\")\n",
180+
"else:\n",
181+
" print(\"Boardgames may be your best alternative.\")\n"
146182
]
147183
},
148184
{
@@ -173,11 +209,18 @@
173209
},
174210
{
175211
"cell_type": "code",
176-
"execution_count": null,
177-
"metadata": {
178-
"collapsed": false
179-
},
180-
"outputs": [],
212+
"execution_count": 7,
213+
"metadata": {},
214+
"outputs": [
215+
{
216+
"name": "stdout",
217+
"output_type": "stream",
218+
"text": [
219+
"Enter the title of a favorite book: Anna katerina\n",
220+
"Anna katerina - consider capitalization throughout for book titles.\n"
221+
]
222+
}
223+
],
181224
"source": [
182225
"# review code and run cell\n",
183226
"favorite_book = input(\"Enter the title of a favorite book: \")\n",
@@ -190,11 +233,19 @@
190233
},
191234
{
192235
"cell_type": "code",
193-
"execution_count": null,
194-
"metadata": {
195-
"collapsed": false
196-
},
197-
"outputs": [],
236+
"execution_count": 10,
237+
"metadata": {},
238+
"outputs": [
239+
{
240+
"name": "stdout",
241+
"output_type": "stream",
242+
"text": [
243+
"enter a positive integer number: one\n",
244+
"one is not a positive integer\n",
245+
"one is more like a word\n"
246+
]
247+
}
248+
],
198249
"source": [
199250
"# review code and run cell\n",
200251
"a_number = input(\"enter a positive integer number: \")\n",
@@ -213,11 +264,18 @@
213264
},
214265
{
215266
"cell_type": "code",
216-
"execution_count": null,
217-
"metadata": {
218-
"collapsed": false
219-
},
220-
"outputs": [],
267+
"execution_count": 12,
268+
"metadata": {},
269+
"outputs": [
270+
{
271+
"name": "stdout",
272+
"output_type": "stream",
273+
"text": [
274+
"\"enter a type of vehicle that starts with \"P\": toyota\n",
275+
"toyota does not start with \"P\"\n"
276+
]
277+
}
278+
],
221279
"source": [
222280
"# review code and run cell\n",
223281
"vehicle_type = input('\"enter a type of vehicle that starts with \"P\": ')\n",
@@ -244,16 +302,30 @@
244302
},
245303
{
246304
"cell_type": "code",
247-
"execution_count": null,
248-
"metadata": {
249-
"collapsed": false
250-
},
251-
"outputs": [],
305+
"execution_count": 18,
306+
"metadata": {},
307+
"outputs": [
308+
{
309+
"name": "stdout",
310+
"output_type": "stream",
311+
"text": [
312+
"Test string 1 is lowercase throughout\n",
313+
"Test string 2 is not lowercase throughout\n"
314+
]
315+
}
316+
],
252317
"source": [
253318
"test_string_1 = \"welcome\"\n",
254319
"test_string_2 = \"I have $3\"\n",
255320
"# [ ] use if, else to test for islower() for the 2 strings\n",
256-
"\n"
321+
"if test_string_1.islower():\n",
322+
" print(\"Test string 1 is lowercase throughout\")\n",
323+
"else:\n",
324+
" print(\"Test string 1 is not lowercase throughout\")\n",
325+
"if test_string_2.islower():\n",
326+
" print(\"Test string 2 is lowercase throughout\")\n",
327+
"else:\n",
328+
" print(\"Test string 2 is not lowercase throughout\")"
257329
]
258330
},
259331
{
@@ -268,19 +340,33 @@
268340
},
269341
{
270342
"cell_type": "code",
271-
"execution_count": null,
272-
"metadata": {
273-
"collapsed": false
274-
},
275-
"outputs": [],
343+
"execution_count": 24,
344+
"metadata": {},
345+
"outputs": [
346+
{
347+
"name": "stdout",
348+
"output_type": "stream",
349+
"text": [
350+
"String does start with a 'w'\n",
351+
"String does not start with a 'w'\n",
352+
"String does not start with a 'w'\n"
353+
]
354+
}
355+
],
276356
"source": [
277357
"test_string_1 = \"welcome\"\n",
278358
"test_string_2 = \"I have $3\"\n",
279359
"test_string_3 = \"With a function it's efficient to repeat code\"\n",
280360
"# [ ] create a function w_start_test() use if & else to test with startswith('w')\n",
281-
"\n",
361+
"def w_start_test(test_string):\n",
362+
" if test_string.startswith('w'):\n",
363+
" print(\"String does start with a 'w'\")\n",
364+
" else:\n",
365+
" print(\"String does not start with a 'w'\")\n",
282366
"# [ ] Test the 3 string variables provided by calling w_start_test()\n",
283-
"\n"
367+
"w_start_test(test_string_1 )\n",
368+
"w_start_test(test_string_2 )\n",
369+
"w_start_test(test_string_3 )"
284370
]
285371
},
286372
{
@@ -308,7 +394,7 @@
308394
"name": "python",
309395
"nbconvert_exporter": "python",
310396
"pygments_lexer": "ipython3",
311-
"version": "3.5.2"
397+
"version": "3.8.8"
312398
}
313399
},
314400
"nbformat": 4,

0 commit comments

Comments
 (0)