Question: In - class Assignment ( 1 0 points ) The Program: Do this as a single program, with a def main ( ) : Write

In-class Assignment (10 points)
The Program:
Do this as a single program, with a def main():
Write a program that uses a dictionary to capture the students name as the key and the student's grade (A, B, C ...) as the value. Start with the following dictionary:
students ={"Tom" : "A", "Mary" : "B", "Jill" : "A", "Mark" : "C"}
Now do the following:
Add a new student "John" with a grade "C" and print the dictionary.
Delete the student "Tom" and print the dictionary.
Modify "Mary" to have an "A" and print the dictionary.
In code with an if statement count how many students have "A". Print the count.
Use the get() function to retrieve the value (the grade) for Mark.
Based on an "if" statement, answer True or False if there is a student call "John". Print the dictionary.
Delete the following "key-value" pair ("Mary","A"). Then print the dictionary.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!