0% 0 Get ready, set, go Time ended Quiz on Python Dictionary This is a comprehensive MCQ quiz on Python Dictionary 1 / 10 1. What would the following code print? d={'spring':'autumn','autumn':'fall','fall':'spring'} print(d['autumn']) A) error B) spring C) fall D) autumn 2 / 10 2. With a dictionary d, d.clear( ) will perform what action? A) dictionary will be emptied B) all values will be removed but not keys C) error D) dictionary will be deleted 3 / 10 3. >>> dict1={'Mohan':95,'Ram':89,'Sohan':74} What will the following statement do ? >>>dict1['Sohan']=75 A) add a new key pair, Sohan:75 B) Update the value of key Sohan to 75 C) add 74 and 75 and put the value to Sohan D) give an error 4 / 10 4. Dictionaries are _________ set of elements A) sorted B) ordered C) unordered D) odd 5 / 10 5. The keys of a dictionary may be: A) any data of mutable type B) Any type of data C) a string D) a list 6 / 10 6. Dictionaires are ____________ data types of Python A) mutable B) immutable C) serial D) unstructured 7 / 10 7. Which of the following is correct with respect to the python code: d={"a":3, "b":7} A) 3 and 7 are the keys of dictionary d B) There are two items in this dictionary C) a dictionary will not be created D) a and b are the values of dictionary d 8 / 10 8. What will be the output of following two lines of python code ? >>>d1={'abc':5,'def':6,'ghi':7} >>>d1[0] A) 5 B) KeyError C) abc D) 5:'abc' 9 / 10 9. What output will following lines of code give ? >>d={'Salary':10000,'age':23,'name':'Johny'} >>>'age' in d A) True B) None of these C) False D) error 10 / 10 10. Which of the following functions will return the key, value pairs of a dictionary? A) keys() B) values() C) pair() D) items() Your score is The average score is 0%Share this quiz with your friends, LinkedIn Facebook Twitter 0% Restart quiz Rate the quiz Send feedback Post navigation Python Quiz – 1 Quiz on Python Lists