Dictionary in Python Quiz #1

Share with others

Enter details 

Q1. Keys of dictionary must be ____________

Q2. Dictionaries in python are _________________.

Q3. Which of the following is used to delete an element in Dictionary?

Q4. We can repeat the values of Key in Dictionary?

Q5. clear() method is used to delete the dictionary.

Q6. Which statement is used to create an empty dictionary?

Q7. Dictionary is a _________ data type.

Q8. Dictionaries are flexible in nature, means elements can be added or removed from it.

Q9. Write the output of the following :

d1 = {"a" : 50, "b" : 50}
d2 = {"a" : 500, "b" : 50}
d1 > d2

Q10. Only values (without keys) can be printed in dictionary?


Share with others

2 thoughts on “Dictionary in Python Quiz #1”

  1. 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

Leave a Reply

error: Content is protected !!