Reply To: Python for-Loop

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

#2343
Jorge
Participant

Hi Erik,

I followed the same command string and the result worked as follow:

>>for  number in ‘12345678910’:

…print(number)

….

1

2

3

4

5

6

7

8

9

1

0

However, I am wondering if there is a better way to achieve this without following the sequence in numbers ‘12345678910’ but rather indicate the variable result of count for numbers between 1 t0 10? also the number 10 was not counted as two digits as one unit but two separate digits…

Just curious to know how I can do this.

Best,

 

JLuna