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