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

Quiz

On line Test- Tuples and Dictionary

Aparna Dhirde 15 questions

Take the quiz

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

Questions in this quiz (15)

  1. 1Slicing is used to extract a part of the tuple
    1. ATrue
    2. BFalse
  2. 2Each key is separated from its value by a colon
    1. ATrue
    2. BFalse
  3. 3Keys are unique and act as the index
    1. ATrue
    2. BFalse
  4. 4Keys are of mutable type but values can be immutable
    1. ATrue
    2. BFalse
  5. 5Elements of tuple is enclosed in square brackets
    1. ATrue
    2. BFalse
  6. 6What will be the output of the following Python code?
    >>>t=(1,2,4,3)
    >>>t[1:-1]
    1. A(1, 2)
    2. B(1, 2, 4)
    3. C(2,4)
    4. D(2, 4, 3)
  7. 7What will be the output of the following Python code?
    >>>t = (1, 2, 4, 3, 8, 9)
    >>>[t[i] for i in range(0, len(t), 2)]
    1. A[2, 3, 9]
    2. B[1, 2, 4, 3, 8, 9]
    3. C[1,4,8]
    4. D(1, 4, 8)
  8. 8What will be the output of the following Python code?
    >>>t = (1, 2)
    >>>2 * t
    1. A[1, 2, 1, 2]
    2. B(1, 1, 2, 2)
    3. C[1, 1, 2, 2]
    4. D(1,2,1,2)
  9. 9What will be the output of the following Python code?
    >>>t1 = (1, 2, 4, 3)
    >>>t2 = (1, 2, 3, 4)
    >>>t1 < t2
    1. ATrue
    2. BFalse
    3. Cerror
    4. Dnone
  10. 10Which of the following statements create a dictionary?
    1. Ad = {}
    2. Bd = {“john”:40, “peter”:45}
    3. Cd = {40:”john”, 45:”peter”}
    4. DAll of the above

Information

Description
Quiz on On line Test- Tuples and Dictionary, created by Aparna Dhirde on 18/03/2020.
Language
English
Views
122
Tags
xi
Rating
No ratings yet
Rate this quiz
Rate this quiz

More on Python Lists and Data Structures

Feedback

What is it about?

What do you think of the new look?

How do you like it?