DEV Community

Cover image for Ibuprofeno.py💊| #173: Explica este código Python
Cristian Fernando
Cristian Fernando

Posted on

Ibuprofeno.py💊| #173: Explica este código Python

Explica este código Python

Dificultad: Fácil

for x in range(3):
    print(x, end=' ')
Enter fullscreen mode Exit fullscreen mode
  • A. 0 3 3
  • B. 0 1 2
  • C. 0
  • D. Error

Respuesta:

👉 B. 0 1 2

Cuando el método range() recibe un solo argumento significa que crearemos un rango desde 0 hasta ese argumento dado menos 1.

En nuestro ejemplo al tener un range(3) el rango iterado será 0 1 2. Justamente eso mostramos por pantalla.

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more