Student Becomes the Teacher
Lesson 1 of 1
1. 1
Welcome to this â€śChallenge Courseâ€ť. Until now weâ€™ve been leading you by the hand and working on some short and relatively easy projects. This is a challenge so be ready. We have faith in you! â€¦
2. 3
Now lets put the three dictionaries in a list together. my_list = [1, 2, 3] The above example is just a reminder on how to create a list. Afterwards, my_list contains 1, 2, and 3.
3. 4
Excellent. Now you need a hard copy document with all of your studentsâ€™ grades. animal_sounds = { â€ścatâ€ť: [â€śmeowâ€ť, â€śpurrâ€ť], â€śdogâ€ť: [â€śwoofâ€ť, â€śbarkâ€ť], â€śfoxâ€ť: [], } print animal_sounds[â€ścatâ€ť] â€¦
4. 5
When teaching a class, itâ€™s important to take the studentsâ€™ averages in order to assign grades. 5 / 2 # 2 5.0 / 2 # 2.5 float(5) / 2 # 2.5 The above example is a reminder of how division worksâ€¦
5. 6
Great! Now we need to compute a studentâ€™s average using weighted averages. cost = { â€śapplesâ€ť: [3.5, 2.4, 2.3], â€śbananasâ€ť: [1.2, 1.8], } return 0.9 * average(cost[â€śapplesâ€ť]) + \ 0.1 * averâ€¦
6. 7
Great work! Now letâ€™s write a get_letter_grade function that takes a number score as input and returns a string with the letter grade that that student should receive.
7. 8
Good! Now letâ€™s calculate the class average. You need to get the average for each student and then calculate the average of those averages.
8. 9
Awesome! Youâ€™re doing great. Now letâ€™s use the functions youâ€™ve created to check on the grade of the class overall.