iterate numbers from 10000 to 100008 in python

You can iterate over a range of numbers in Python using a for loop. Here's how you can iterate numbers from 10000 to 100008:

main.py
for i in range(10000, 100009):
    print(i)
44 chars
3 lines

This will print each number from 10000 to 100008 on a new line. If you want to store these numbers in a list, you can do it like this:

main.py
numbers = []
for i in range(10000, 100009):
    numbers.append(i)
66 chars
4 lines

Now the numbers list will contain all the numbers from 10000 to 100008.

related categories

gistlibby LogSnag