1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# 1st version with for loop.
for i in range(1, 1001):
    print(i)


# 2nd version with while loop.
i = 1
while i < 1001:
    print(i)
    i = i + 1


range(1, 1001)


# count every number from 1 to 1000.
i = 1
total = 0
while i < 1001:
    print(i)
    i = i + 1
    total = total + i