Dictionary in Python Quiz #1 Share with others Enter details Name E-mail School Name Q1. Keys of dictionary must be ____________ antique unique mutable integers None Q2. Dictionaries in python are _________________. Mutable data type Mapping data type Both of the above Non-Mutable data type None Q3. Which of the following is used to delete an element in Dictionary? pop() delete remove None of the above None Q4. We can repeat the values of Key in Dictionary? True False None Q5. clear() method is used to delete the dictionary. True False None Q6. Which statement is used to create an empty dictionary? d1 = { } d1 = ( ) d1 = dict{ } d1 = [ ] None Q7. Dictionary is a _________ data type. Sequence Mapping None Q8. Dictionaries are flexible in nature, means elements can be added or removed from it. True False None Q9. Write the output of the following : d1 = {"a" : 50, "b" : 50}d2 = {"a" : 500, "b" : 50}d1 > d2 True False Error None Q10. Only values (without keys) can be printed in dictionary? True False None Time's upTime is Up! Related Share with others
Que 3: Correct ans is both pop and delete , by using delete we can also delete element from dictionary di={“a”:4,”b”:43,”c”:5} di {‘a’: 4, ‘b’: 43, ‘c’: 5} del di[“a”] di {‘b’: 43, ‘c’: 5} Reply
Que 3: Correct ans is both pop and delete , by using delete we can also delete element from dictionary
di={“a”:4,”b”:43,”c”:5}
di
{‘a’: 4, ‘b’: 43, ‘c’: 5}
del di[“a”]
di
{‘b’: 43, ‘c’: 5}
Hi, We can delete the element by using del not delete