creating a dictionary that contains username as the key and password as the associated values. Make up the data for five dictionary enteries and demonstrate the use of clear and fromkeys() method. code example
Example 1: python create dictionary from key value
>>> L1 = ['a','b','c','d']
>>> L2 = [1,2,3,4]
>>> d = dict(zip(L1,L2))
>>> d
{'a': 1, 'b': 2, 'c': 3, 'd': 4}
Example 2: how to create a new dictionary in python
myDict = {'first item' : 'definition'}
#CREATING A BLANK DICTIONARY
myDict = {}