VOOZH about

URL: https://www.geeksforgeeks.org/quizzes/python-dictionary-quiz/

⇱ Quiz about Python Dictionary Quiz


Last Updated :
Discuss
Comments

Question 1

What will be the output of the following code?

  • {'a': 5, 'b': 10}

  • {'a': 15, 'b': 10}

  • Error

  • {'a': 15}

Question 2

Find the output of the following program:

  • {0: 1, 7: 0, 1: 1, 8: 0}

  • {1: 1, 7: 2, 0: 1, 8: 1}

  • {0: 0, 7: 0, 1: 1, 8: 1}

  • KeyError

Question 3

Find the output of the following program:

  • Compilation error due to duplicate keys

  • Runtime time error due to duplicate keys

  • 3

  • 1

Question 4

Find the output of the following program:

  • 0

  • 1

  • 2

  • 3

Question 5

Find the output of the following program:

  • 1

  • 2

  • 3

  • 4

Question 6

Find the output of the following program:

  • {β€˜b’: [2], β€˜a’: 1}

  • {'a': 1, 'b': [2, 3, 4]}

  • {β€˜b’: [2], β€˜a’: [3]}

  • Error

Question 7

Find the output of the following program:

  • Error

  • 0

  • 1

  • 2

Question 8

Find the output of the following program:

  • 2

  • 4

  • 1

  • Error

Question 9

Find the output of the following program:

  • del deletes the entire dictionary

  • del doesn’t exist for the dictionary

  • del deletes the keys in the dictionary

  • del deletes the values in the dictionary

Question 10

Find the output of the following program:

  • 10

  • False

  • True

  • Error

There are 24 questions to complete.

Take a part in the ongoing discussion