Reply To: Python for-Loop

Welcome to Python Land Forums The Python Tutorial Python for-Loop Reply To: Python for-Loop

#2340
Jorge
Participant

My apologies Erik.

In the example you provided Python for- Loop:

>> for letter in ‘ Hello’:

…    print (letter)

H

e

l

l

o

I am wondering if the same can be executed as:

>> for the number ’10’

…    print(number) 1 to 10

How can execute a similar command to achieve this?

Thank you for your help.

JLuna