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

ibuprofeno.py|-#173:-explica-este-codigo-python

Explica este código Python


Dificultad: Fácil

for x in range(3):
    print(x, end=' ')
  • 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.

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post
how-to-set-(crushable)-marketing-goals,-according-to-hubspot-pros

How to Set (Crushable) Marketing Goals, According to HubSpot Pros

Next Post
ai-assisted-search-will-change-the-pay-to-play-games-for-content-marketers

AI-Assisted Search Will Change the Pay-To-Play Games for Content Marketers

Related Posts