Python Forum
Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can Python do that
#3
Yes, this is the code I wrote, it displays the time left, but it only counts down with seconds, not like 1m 30s... 1m 29s, and so on.
import time
sec=0

sec = int(input("hello! To how many seconds would you lke to set your timer to?"))
sec = sec + 1
for i in reversed(range(sec)):
    print(i)
    time.sleep(1)
Reply


Messages In This Thread
Can Python do that - by hello_its_me - Dec-30-2017, 06:38 PM
RE: Can Python do that - by squenson - Dec-30-2017, 06:45 PM
RE: Can Python do that - by RandomCoder - Jan-07-2018, 02:02 PM
RE: Can Python do that - by squenson - Jan-07-2018, 02:31 PM
RE: Can Python do that - by RandomCoder - Jan-07-2018, 03:01 PM
RE: Can Python do that - by karaokelove - Jan-07-2018, 07:37 PM
RE: Can Python do that - by RandomCoder - Jan-08-2018, 02:33 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020