GoConqr has a new look! Let us know what you think.

Quiz

Online Test List & Dictionary

Aparna Dhirde 20 questions

Take the quiz

This quiz has a time limit, so it opens in the usual player.

Questions in this quiz (20)

  1. 1Keys in dictionary are of mutable type but values can be immutable.
    1. ATrue
    2. BFalse
  2. 2List is enclosed in square brackets
    1. ATrue
    2. BFalse
  3. 3Slicing is used to extract a part of the list
    1. ATrue
    2. BFalse
  4. 4Each key is separated from its value by a colon.
    1. ATrue
    2. BFalse
  5. 5Keys are unique and act as the index.
    1. ATrue
    2. BFalse
  6. 6If a is a dictionary with some key-value pairs, what does a.popitem() do?
    1. ARemoves an arbitrary element
    2. BRemoves all the key-value pairs
    3. CRemoves the key-value pair for the key given as an argument
    4. DInvalid method for dictionary
  7. 7What will be the output of the following Python code snippet?
    >>> a={1:"A",2:"B",3:"C"}
    >>> del a
    1. Amethod del doesn’t exist for the dictionary
    2. Bdel deletes the values in the dictionary
    3. Cdel deletes the entire dictionary
    4. Ddel deletes the keys in the dictionary
  8. 8Which of the statements about dictionary values if false?
    1. AMore than one key can have the same value
    2. BThe values of the dictionary can be accessed as dict[key]
    3. CValues of a dictionary must be unique
    4. DValues of a dictionary can be a mixture of letters and numbers
  9. 9What will be the output of the following Python code snippet?
    a={1:"A",2:"B",3:"C"}
    print(a.get(5,4))
    1. AError, invalid syntax
    2. BA
    3. C5
    4. D4
  10. 10What will be the output of the following Python code snippet?
    a={1:"A",2:"B",3:"C"}
    print(a.get(1,4))
    1. A1
    2. BA
    3. C4
    4. DInvalid syntax for get method

Information

Description
Quiz on Online Test List & Dictionary, created by Aparna Dhirde on 17/03/2020.
Language
English
Views
39
Tags
xi
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?