Python Forum
countdown script not working..plz help what is mistake
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
countdown script not working..plz help what is mistake
#1
countdown script not working..plz help what is mistake



import time

def countdown(t):
    while t:
        mins, secs = divmod(t, 60)
        timeformat = '{:02d}:{:02d}'.format(mins, secs)
        print(timeformat, end='\r')
        time.sleep(1)
        t -= 1
    print('Goodbye!\n\n\n\n\n')
Reply
#2
What exactly is not working?
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Solved] Please, help me find a simple mistake AlekseyPython 2 1,734 Jun-17-2021, 12:20 PM
Last Post: AlekseyPython
  [split] Could you please clarify where i did mistake also how run without admin right Abubakkar 1 1,784 Jun-14-2021, 09:32 AM
Last Post: Larz60+
  Please help to me to find my mistake in code leonardin 2 1,834 Nov-29-2020, 04:17 PM
Last Post: Larz60+
  minor mistake in code for factorial spalisetty06 2 1,877 Aug-22-2020, 05:00 PM
Last Post: spalisetty06
  Simple mistake about for Nomatter 4 2,226 Jul-16-2020, 02:24 PM
Last Post: Nomatter
  for loop script over telnet in Python 3.5 is not working abhijithd123 1 2,895 May-10-2020, 03:22 AM
Last Post: bowlofred
  Install Mistake jlerette5 1 1,888 Feb-18-2020, 12:19 AM
Last Post: jefsummers
  What was my mistake in this Python code (easy)? voltman 4 3,440 Nov-19-2019, 09:58 PM
Last Post: snippsat
  Beginner mistake. bbweeg 1 2,029 Aug-17-2019, 07:27 AM
Last Post: perfringo
  picamera not working on premade script georgeaura 1 2,518 Jul-24-2019, 10:11 AM
Last Post: gontajones

Forum Jump:

User Panel Messages

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