¡GoConqr estrena diseño! Cuéntanos qué te parece.

Test

Tuples in Python

PathaPadha Support 12 preguntas

Hacer el test

Este test tiene tiempo límite, así que se abre en el reproductor de siempre.

Preguntas del test (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. AVerdadero
    2. BFalso
  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

Información

Descripción
Coding Python Test sobre Tuples in Python, creado por PathaPadha Support el 27/10/2020.
Idioma
English
Visitas
405
Etiquetas
pythoncoding
Valoración
Aún sin valoraciones
Valora este test
Valora este test

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?