Write Python programs to print numbers from 1 to 10000 while loops 1

Write Python programs to print numbers from 1 to 10000 while loops

i = 1
while(i<=10):
    print(i)
    i += 1

Here is what the above code is Doing:
1. We initialize a variable i to 1.
2. We check if i is less than or equal to 10.
3. If it is, we print the value of i and then increment i by 1.
4. We repeat steps 2 and 3 until i is no longer less than or equal to 10.

Similar Posts