+ 1
how to make a timer in python with one second delay
n=100 while n>0: print(n) n=n-1
2 Answers
+ 3
sahil Kumar
from time import sleep
i = 0
while i < 5:
i += 1
sleep(1)
print(i)
print(f"\n{i} seconds have passed.")
https://sololearn.com/compiler-playground/cs8wXtIlFq4y/?ref=app
+ 3
You can't do this "in real-time" with the Sololearn compiler. However, you can check out if there's a sleep method and see how it might work.
https://sololearn.com/compiler-playground/WZ8lkR6gTex6/?ref=app
https://sololearn.com/compiler-playground/W0uW3Wks8UBk/?ref=app
https://sololearn.com/compiler-playground/W3uiji9X28C1/?ref=app
https://www.sololearn.com/discuss/2836522/?ref=app
https://www.sololearn.com/discuss/1473687/?ref=app
https://www.sololearn.com/discuss/103741/?ref=app
https://www.sololearn.com/discuss/707366/?ref=app