close
close

first Drop

Com TW NOw News 2024

Ibuprofeno.py๐Ÿ’Š| #170: Python code explanation
news

Ibuprofeno.py๐Ÿ’Š| #170: Python code explanation

Explain this Python code


Difficult: Easy

for k in range(3, 9, 2):
    print(k, end=' ')
Go to full screen mode

Exit full screen

  • A. 5 6 7
  • B. 3 5 7
  • C. 3 6 9
  • D. Error

Answer:

๐Ÿ‘‰ B. 3 5 7

The method range() the Python accepts 3 parameters: inicio, fin y salto; the marks are ready and have put the bucle and the salt in the “brincarรก” of the bucle.

Now the cycle starts at 3, ends at 8 and 3 at 3 positions. The balances are 3 5 7.