Multiple Choice Questions -Lists

Descripción

Test sobre Multiple Choice Questions -Lists, creado por Aparna Dhirde el 17/03/2020.
Aparna Dhirde
Test por Aparna Dhirde, actualizado hace más de 1 año
Aparna Dhirde
Creado por Aparna Dhirde hace más de 4 años
71
0

Resumen del Recurso

Pregunta 1

Pregunta
What is the output when we execute list(“hello”)?
Respuesta
  • [‘h’, ‘e’, ‘l’, ‘l’, ‘o’]
  • [‘hello’]
  • [‘llo’]
  • [‘olleh’]

Pregunta 2

Pregunta
Suppose listExample is [‘h’,’e’,’l’,’l’,’o’], what is len(listExample)?
Respuesta
  • 5
  • 4
  • none
  • error

Pregunta 3

Pregunta
Suppose list1 is [2445,133,12454,123], what is max(list1)?
Respuesta
  • 2445
  • 133
  • 12454
  • 123

Pregunta 4

Pregunta
Suppose list1 is [1, 5, 9], what is sum(list1)?
Respuesta
  • 1
  • 9
  • 15
  • error

Pregunta 5

Pregunta
Suppose list1 is [2, 33, 222, 14, 25], What is list1[-1]?
Respuesta
  • error
  • none
  • 25
  • 2

Pregunta 6

Pregunta
To add a new element to a list we use which command?
Respuesta
  • list1.add(5)
  • list1.append(5)
  • list1.addLast(5)
  • list1.addEnd(5)

Pregunta 7

Pregunta
Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after list1.reverse()?
Respuesta
  • [3, 4, 5, 20, 5, 25, 1, 3]
  • [1, 3, 3, 4, 5, 5, 20, 25]
  • [25, 20, 5, 5, 4, 3, 3, 1]
  • [3, 1, 25, 5, 20, 5, 4, 3]

Pregunta 8

Pregunta
Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after listExample.extend([34, 5])?
Respuesta
  • [3, 4, 5, 20, 5, 25, 1, 3, 34, 5]
  • [1, 3, 3, 4, 5, 5, 20, 25, 34, 5]
  • [25, 20, 5, 5, 4, 3, 3, 1, 34, 5]
  • [1, 3, 4, 5, 20, 5, 25, 3, 34, 5]

Pregunta 9

Pregunta
Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after listExample.pop(1)?
Respuesta
  • [3, 4, 5, 20, 5, 25, 1, 3]
  • [1, 3, 3, 4, 5, 5, 20, 25]
  • [3, 5, 20, 5, 25, 1, 3]
  • [1, 3, 4, 5, 20, 5, 25]

Pregunta 10

Pregunta
Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after listExample.pop()?
Respuesta
  • [3, 4, 5, 20, 5, 25, 1]
  • [1, 3, 3, 4, 5, 5, 20, 25]
  • [3, 5, 20, 5, 25, 1, 3]
  • [1, 3, 4, 5, 20, 5, 25]

Pregunta 11

Pregunta
What will be the output of the following Python code? >>>list("a#b#c#d".split('#'))
Respuesta
  • [‘a’, ‘b’, ‘c’, ‘d’]
  • [‘a b c d’]
  • [‘a#b#c#d’]
  • [‘abcd’]

Pregunta 12

Pregunta
What will be the output of the following Python code? list1 = [1, 2, 3, 4] list2 = [5, 6, 7, 8] print(len(list1 + list2))
Respuesta
  • 2
  • 4
  • 5
  • 8

Pregunta 13

Pregunta
To which of the following the “in” operator can be used to check if an item is in it?
Respuesta
  • Lists
  • Dictionary
  • Set
  • All of the mentioned
Mostrar resumen completo Ocultar resumen completo

Similar

PASAPALABRA  sobre  ANATOMÍA
JL Cadenas
LA PRIMERA GUERRA MUNDIALO LA GRAN GUERRA - creado desde un Mapa Mental
Erika Urban
Causas principales de la Primera Guerra Mundial
crisferroeldeluna
La Guerra Civil Española
maya velasquez
Qué Carrera Estudiar
Diego Santos
AMÉRICA: PAÍSES~CAPITALES...
Ulises Yo
Países y capitales de América
Sabina Sosa
Diagrama QCLD
Andrea Castro Romero
Mapas Conceptuales con GoConqr
Diego Santos
SOSTENIBILIDAD
Carlos Párraga
Diferenciación de términos de Manejo Ambiental.
Néstor Humberto Mateus Pulido