In: Computer Science
Using Python, write a program named hw3a.py that meets the following requirements:
#creating the Dictionary with name glossary
glossary = {
"List": "List is a collection which is ordered and changeable
Allows duplicate members",
"Dictionary":" is a collection which is unordered, changeable and
indexed. No duplicate members",
"set":"Set is a collection which is unordered and unindexed. No
duplicate members.",
"and":"The and keyword is a logical operator, and is used to
combine conditional statements",
"or":"The or keyword is a logical operator, and is used to combine
conditional statements:"
}
for x in glossary:#Print all keys and values in the dictionary, one
by one:
print(x,"=",glossary[x])
# Empty list
people=[]
Person= { 'Person1': { }, # nested dictionary
'Person2': {
},
'Person3':{ }}
# Nested dictionary having same keys
Person= { 'Person1': {'firs tname': 'siva','last name':'ram',
'age': '19','city':'Hyderabad'},
'Person2':{'firs
tname': 'harbajan','last name':'singh', 'age':
'29','city':'vizag'},
'Person3':{'firs
tname': 'sai','last name':'kumar', 'age': '16','city':'Delhi'}}
people.append(Person)#appeding to list
for x in Person:#Print all keys and values in the dictionary, one
by one:
print(x,"=",Person[x])