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