Originally Posted by
Poem
i have a very simple question pertaining the code below.
Code:
for number in range(35225124124214152):
if number <= 5:
print "x"
else:
print "y"
instead of going through 35225124124214152 numbers before printing out the results, how can I have the numbers printed one at a time?
(printing out the result for number 1 before moving on to check number 2)
thanks in advance.
Do you mean you want it to go through them all and then print out the results? Right now it is printing them out as it goes. If you have it pause between numbers you can see that it prints out one at a time.
Code:
import time
for number in range(1000):
if number <= 5:
print "x"
else:
print "y"
time.sleep(5)