IT 117: Intermediate Scripting
Class 06 Ungraded Quiz
-
Write the Python statement to create an empty dictionary named
students.
-
What is the length of an empty dictionary?
-
Write the Python statement to create an entry in the
students dictionary for a student
with student ID '0123456' whose name is 'John Smith'.
-
Write the Python expression you would use to test whether the
students dictionary contains
an entry for a student with the ID '0123456'.
-
Write the Python expression you would use to test whether the
students dictionary DOES NOT contain
an entry for a student with the ID '0123456'.
-
Write the Python statement you would use to delete the entry in the
students dictionary with
key value '0123456'.
-
What would happen if you tried to delete a dictionary entry using a key
that was NOT in the dictionary?
-
What does the length of a dictionary mean?
-
Write the Python expression you would use to get the number of entries in a dictionary
students.
-
Can dictionary entries be accessed by their position?