- 1
Why does "none" show?
"none" shows before each number in output when I use time.sleep(1) in print function. how come? how can I fix this? import time i = 0 while 1==1: print(time.sleep(1),i) i = i + 1 if i >= 6: break f = 6 while 6>-1: print(time.sleep(1),f) f = f -1 if f == -1: print("Finished") break
3 Answers
+ 5
One does not simply print time.sleep() it's a void method that returns none
+ 1
if you just want it to cout to 6 and then back to 0 remove time.sleep(1) from print and put it on the line above the print statement.
+ 1
@emmey thanks that works