Question: 8. The following exercise will help us review the differences between lists and dictionaries. Modify your previous program so that the program does the following
8.
The following exercise will help us review the differences between lists and dictionaries. Modify your previous program so that the program does the following AFTER it prints the keys and values of the enzymes dictionary to the screen:
creates two empty lists, one called enzyme_names and one called enzyme_sites.
uses a for loop to examine each key-value pair from the dictionary.
within the for loop, adds each key to the enzyme_names list and adds each value to the enzyme_sites list.
after the for loop has completed, prints the dictionary, the enzyme_names list, and the enzyme_sites list to the screen.
The output of your program should look like this:
EcoRI GAATTC
BamHI GGATCC
XbaI TCTAGA
{'EcoRI': 'GAATTC', 'BamHI': 'GGATCC', 'XbaI': 'TCTAGA'}
['EcoRI', 'BamHI', 'XbaI']
['GAATTC', 'GGATCC', 'TCTAGA']
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
