CIS 41A Unit D, Exercise D

Write one script with three parts.

At the top of your script, put the following multi-line comment with your information:

'''
Your name as registered, with optional nickname in parentheses
CIS 41A   Fall 2021
Unit D, Exercise D
'''

All print output should include descriptions as shown in the example output below.

1) Dictionary Basics:
  1. Create a dictionary of fruit and desserts made from the fruit. The fruit should be the key and the dessert should be the value. Use these key value pairs:
    apple:sauce
    peach:cobbler
    carrot:cake
    strawberry:sorbet
    banana:cream pie
  2. Add the mango fruit to the dictionary. Its dessert is sticky rice.
  3. Change the strawberry dessert to shortcake.
  4. Carrot is not a fruit, so remove carrot from the dictionary.
  5. Print the apple dessert.
  6. See if a banana dessert exists.
  7. See if a pear dessert exists.
  8. Print the keys in the dessert dictionary.
  9. Print the values in the dessert dictionary.
  10. Print the key-value pairs in the dessert dictionary.
2) Combining dictionaries:
  1. Create a dictionary named capitols1 and populate it with these key value pairs:
    Alabama:Montgomery
    Alaska:Juneau
    Arizona:Phoenix
    Arkansas:Little Rock
    California:Sacramento
  2. Create a dictionary named capitols2 and populate it with these key value pairs:
    California:Sac.
    Colorado:Denver
    Connecticut:Hartford
    Be sure that the California capitol is Sac. and not Sacramento.
  3. Using the dictionary update() method, update capitols1 with capitols2.
  4. Print the sorted capitols (values). Note the updated value of California's capitol.
3) Sets Basics:
  1. Create a set named class1 and populate it with the students Li, Audry, Jia, Migel, Tanya.
  2. Create a set named class2 and populate it with the students Sasha, Miguel, Tanya, Hiroto, Audry.
  3. Add John to class1.
  4. Print a sorted list of students who are in both classes.
  5. Print a sorted list of all students.
  6. Test to see if Sasha is in class1.

Sample Execution Results:

apple dessert is: sauce
banana dessert exists: True
pear dessert exists: False
dict_keys(['apple', 'peach', 'strawberry', 'banana', 'mango'])
dict_values(['sauce', 'cobbler', 'shortcake', 'cream pie', 'sticky rice'])
dict_items([('apple', 'sauce'), ('peach', 'cobbler'), ('strawberry', 'shortcake'), ('banana', 'cream pie'), ('mango', 'sticky rice')])
Sorted state capitols: ['Denver', 'Hartford', 'Juneau', 'Little Rock', 'Montgomery', 'Phoenix', 'Sac.']
Students in both classes: ['Audry', 'Migel', 'Tanya']
All students: ['Audry', 'Hiroto', 'Jia', 'John', 'Li', 'Migel', 'Sasha', 'Tanya']
Sasha is in class1: False

Add the following at the end of the script to show your results:

'''
Execution results:
paste execution results here
'''

Submit your finished py script in Canvas, Exercise D.