Course Content
Introduction to Python
Introduction to Python
Challenge: Updating Dictionary
Swipe to start coding
You are given the dictionary students_grades
, where the student's name is the key, and their exam grade is the value.
Some students came to take the exam because they were previously not allowed, so they need to be added to the dictionary. Also, one student improved their poor grade, so their grade in the dictionary needs to be updated.
- Add the student
John
with a grade of75
. - Add the student
Alice
with a grade of92
. - Change the grade of the student
Peter
from54
to84
.
Solution
Thanks for your feedback!
Challenge: Updating Dictionary
Swipe to start coding
You are given the dictionary students_grades
, where the student's name is the key, and their exam grade is the value.
Some students came to take the exam because they were previously not allowed, so they need to be added to the dictionary. Also, one student improved their poor grade, so their grade in the dictionary needs to be updated.
- Add the student
John
with a grade of75
. - Add the student
Alice
with a grade of92
. - Change the grade of the student
Peter
from54
to84
.
Solution
Thanks for your feedback!