1#the bug is that it does not stop counting!
2import time
3n = 0
4
5
6while ( n <= 1000000):
7 n = n + 1
8 print(n)
9 time.sleep(0) #you can change the sleep to the number of seconds you want
10
11else:
12 n == 1
13
14print("finished!")
15
1#counting from 1 million to 1, using while loop
2import time
3n = 1000000
4
5
6while ( n <= 1000000):
7 n = n - 1
8 print(n)
9 time.sleep(0)
10
11else:
12 n == 1
13
14print("finished!")
15
16