0% 1 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) fall B) error C) spring D) autumn 2 / 10 2. What will be the output of following two lines of python code ? >>>d1={'abc':5,'def':6,'ghi':7} >>>d1[0] A) abc B) 5 C) 5:'abc' D) KeyError 3 / 10 3. With a dictionary d, d.clear( ) will perform what action? A) dictionary will be deleted B) dictionary will be emptied C) all values will be removed but not keys D) error 4 / 10 4. Dictionaires are ____________ data types of Python A) immutable B) unstructured C) serial D) mutable 5 / 10 5. The keys of a dictionary may be: A) any data of mutable type B) a list C) Any type of data D) a string 6 / 10 6. What output will following lines of code give ? >>d={'Salary':10000,'age':23,'name':'Johny'} >>>'age' in d A) error B) None of these C) True D) False 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) a and b are the values of dictionary d C) a dictionary will not be created D) There are two items in this dictionary 8 / 10 8. >>> dict1={'Mohan':95,'Ram':89,'Sohan':74} What will the following statement do ? >>>dict1['Sohan']=75 A) give an error B) add a new key pair, Sohan:75 C) Update the value of key Sohan to 75 D) add 74 and 75 and put the value to Sohan 9 / 10 9. Dictionaries are _________ set of elements A) sorted B) ordered C) odd D) unordered 10 / 10 10. Which of the following functions will return the key, value pairs of a dictionary? A) items() B) values() C) pair() D) keys() Your score is The average score is 80%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