Dictionaries Warm Up#

Section Title: Dictionaries Warm Up

Warm Up Question-1#

Create a dictionary where the keys are the names of three students, and the values are their three digit ID numbers.

Warm Up Question-2#

Add a new pair to the following dictionary:

student_ID = {'Joe':394, 'Tim':921, 'Amy':861}

Warm Up Question-3#

Replace 861 with 195 in the following dictionary:

student_ID = {'Joe':394, 'Tim':921, 'Amy':861}

Warm Up Question-4#

Remove the (‘Joe’, 394) pair from the following dictionary:

student_ID = {'Joe':394, 'Tim':921, 'Amy':861}

Warm Up Question-5#

Use the get() method to check for ‘Michael’ in the dictionary and return 999 if the country name is not a key. country_capital = {‘France’:’Paris’, ‘Italy’:’Rome’, ‘Germany’:’Berlin’}

student_ID = {'Joe':394, 'Tim':921, 'Amy':861}

Warm Up Question-6#

Remove the (‘Tim’, 921) pair from the following dictionary using the pop() method::

student_ID = {'Joe':394, 'Tim':921, 'Amy':861}

Warm Up Question-7#

Find the sum of the values of the student_ID dictionary.

student_ID = {'Joe':394, 'Tim':921, 'Amy':861}