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

Quiz

Tuples in Python

PathaPadha Support 12 questions

Take the quiz

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

Questions in this quiz (12)

  1. 1What is the output of the following ?

    tuple1 = (1120, 'a')
    print(max(tuple1))
    1. ATypeError
    2. B1120
    3. C‘a’
  2. 2What is the output of the following tuple operation ?

    aTuple = (100,)
    print(aTuple * 2)
    1. ATypeError
    2. B(100, 100)
    3. C(200)
  3. 3Select true statements regarding the Python tuple
    1. AWe can remove the item from tuple but we cannot update items of the tuple
    2. BWe cannot delete the tuple
    3. CWe cannot remove the items from the tuple
    4. DWe cannot update items of the tuple.
  4. 4What is the output of the following tuple operation ?

    aTuple = (100, 200, 300, 400, 500)
    aTuple.pop(2)
    print(aTuple)
    1. A(100, 200, 400, 500)
    2. B(100, 300, 400, 500)
    3. CAttributeError
  5. 5Select which is true for Python tuple
    1. AA tuple maintains the order of items
    2. BWe can change the tuple once created
    3. CWe cannot change the tuple once created
    4. DA tuple is unordered
  6. 6A Python tuple can also be created without using parentheses
    1. ATrue
    2. BFalse
  7. 7Choose the correct way to access value 20 from the following tuple

    aTuple = ("Orange", [10, 20, 30], (5, 15, 25))
    1. AaTuple[1:2][1]
    2. BaTuple[1:2](1)
    3. CaTuple[1:2][0]
    4. DaTuple[1][1]
  8. 8What is the output of the following code ?

    aTuple = (100, 200, 300, 400, 500)
    aTuple[1] = 800
    print(aTuple)
    1. ATypeError
    2. B(100, 800, 200, 300, 400, 500)
    3. C(800, 100, 200, 300, 400, 500)
  9. 9What is the output of the following ?

    aTuple = (10, 20, 30, 40, 50, 60, 70, 80)
    print(aTuple[2:5], aTuple[:4], aTuple[3:])
    1. A(30, 40, 50) (10, 20, 30, 40) (40, 50, 60, 70, 80)
    2. B(20, 30, 40, 50) (10, 20, 30, 40) (30, 40, 50, 60, 70, 80)
    3. C(30, 40, 50) (10, 20, 30, 40) (40, 50, 60, 70)
    4. D(30, 40, 50) (10, 20, 30) (40, 50, 60, 70, 80)
  10. 10What is the type of the following variable ?

    aTuple = ("Orange")
    print(type(aTuple))
    1. Alist
    2. Btuple
    3. Carray
    4. Dstr

Information

Description
Coding Python Quiz on Tuples in Python, created by PathaPadha Support on 27/10/2020.
Language
English
Views
405
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?