GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Quiz

Online Test List & Dictionary

Aparna Dhirde 20 Fragen

Quiz starten

Dieses Quiz hat ein Zeitlimit und öffnet sich deshalb im gewohnten Player.

Fragen in diesem Quiz (20)

  1. 1Keys in dictionary are of mutable type but values can be immutable.
    1. ARichtig
    2. BFalsch
  2. 2List is enclosed in square brackets
    1. ARichtig
    2. BFalsch
  3. 3Slicing is used to extract a part of the list
    1. ARichtig
    2. BFalsch
  4. 4Each key is separated from its value by a colon.
    1. ARichtig
    2. BFalsch
  5. 5Keys are unique and act as the index.
    1. ARichtig
    2. BFalsch
  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

Informationen

Beschreibung
Quiz am Online Test List & Dictionary, erstellt von Aparna Dhirde am 17/03/2020.
Sprache
English
Aufrufe
39
Schlagwörter
xi
Bewertung
Noch keine Bewertungen
Bewerte dieses Quiz
Bewerte dieses Quiz

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck