Jump to: navigation, search

OPS435 Online Lab4

2 bytes added, 11:54, 15 October 2020
Create a Python Script for Managing Dictionaries
:::*The script should contain '''two''' functions:
:::::'''create_dictionary()'''<ol><li>'''accepts''' two lists as arguments keys and values, '''combines''' these lists together to '''create''' a dictionary<br>('''Tip:''' use a for while loop to access elements in both the keys and values lists at the same time)</li><li>'''returns a dictionary''' that has the keys and associated values from the lists</li></ol>
:::::'''shared_values()''' <ol><li>'''accepts''' two dictionaries as arguments and '''finds''' all values that are shared between the two dictionaries<br>('''Tip:''' generate sets containing only values for each dictionary, then use a function mentioned in a previous section to store the values that are common to <u>both</u> lists)</li><li>'''returns a set''' containing '''ONLY values''' found in '''BOTH dictionaries'''</li></ol>
:::*make sure the functions have the correct number of arguments required

Navigation menu