QuestenaPráctica que te muestra qué repasar después
Pregunta 106

When text is a string, which statement describes the value produced by text[1:3] and its effect on text?

  1. It is a character list that mutates text.
  2. It is a str value, and text is unchanged.Respuesta correcta
  3. It is a view that can edit text.
  4. It is always a one-character string.

Explicación

Slicing a string produces another string value, while the original remains unchanged because strings are immutable. A list of characters would require a separate conversion, and assigning the result to a name cannot mutate the source.

Continúa con este test

Empezar la práctica
Pregunta 106: When text is a string, which statement describes the value… · Python Fundamentals · Questena