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

Quiz

Tuples in Python

PathaPadha Support 12 Fragen

Quiz starten

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

Fragen in diesem 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. ARichtig
    2. BFalsch
  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

Informationen

Beschreibung
Coding Python Quiz am Tuples in Python, erstellt von PathaPadha Support am 27/10/2020.
Sprache
English
Aufrufe
405
Schlagwörter
pythoncoding
Bewertung
Noch keine Bewertungen
Bewerte dieses Quiz
Bewerte dieses Quiz

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck