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