QUIZ Time Starts !

5 minutes

Thanks you have successfully attempted the quiz.


Python Dictionary Quiz

Fill Out the Form to Attempt the test.

1 / 15

What is the difference between get() and direct key access in a dictionary?

2 / 15

What happens if you use a mutable type like a list as a dictionary key?

3 / 15

What will the following code print? my_dict = {'x': 10, 'y': 20}; my_dict.update({'z': 30}); print(my_dict)

4 / 15

What is the result of len(my_dict) in Python?

5 / 15

What does the popitem() method do in a dictionary?

6 / 15

How do you check if a key exists in a dictionary?

7 / 15

What will the following code print? my_dict = {'a': 1, 'b': 2}; my_dict['c'] = 3; print(my_dict)

8 / 15

What does the items() method return in a dictionary?

9 / 15

Which method adds a new key-value pair to an existing dictionary?

10 / 15

How do you remove a key-value pair from a dictionary?

11 / 15

What will the following code return? my_dict = {'a': 1, 'b': 2, 'c': 3}; my_dict.get('d', 'Not Found')

12 / 15

Which of the following can be a valid key in a Python dictionary?

13 / 15

What method is used to retrieve all keys from a Python dictionary?

14 / 15

How do you define a dictionary in Python?

15 / 15

What is a dictionary in Python?

Your score is