Q1. What is the syntax to create a dictionary?
a. D = []
b. D = {}
c. D = ()
d. D = dictionary()
Q2. What is the correct statement about dictionaries?
a. There can be multiple same keys.
b. Every value must be unique.
c. Every key must be unique.
d. We can’t get every key from the dictionary.
Q3. What is the correct syntax to get all the keys only from a dictionary d?
a. d.key()
b. d.item()
c. d.value()
d. d.keys()
Q4. What will be the output of the following code?
d = {‘a’: 20, ‘b’:’30’}
print (d.values())
a. 20 ‘30’
b. ‘20’ ‘30’
c. 20 30
d. a b
NPTEL The Joy Of Computing Using Python Assignment 5 Answers (Week 5)
OR, GO THROUGH THE BELOW LINK FOR ANSWER: