0

Times up quiz has error

In the basic python course I supplied this code and was told it was incorrect. When I run it I get the correct answer. import time # Take the number as input number = int(input("Enter the number of seconds: ")) print(f"Starting countdown from: {number}") # Debugging line # Use a while loop for the countdown while number >= 0: # Ensures the countdown reaches 0 print(number) # Print the current number time.sleep(1) # Pause for 1 second number -= 1 # Decrement the counter

11th Mar 2025, 12:50 AM
Rikk Sullenberger
Rikk Sullenberger - avatar
5 Respostas
+ 6
Dismissed the extra print stuff you only need the print(number) No Enter the number in seconds No print( f-string ) c = int(input()) while c >= 0: print(c) c -= 1
11th Mar 2025, 2:01 AM
BroFar
BroFar - avatar
+ 4
Rikk Sullenberger you made this harder than the practice required. # take the number as input number = int(input()) #use a while loop for the countdown while number >= 0: print(number) number -=1 Yes your code works but ...
11th Mar 2025, 1:15 AM
BroFar
BroFar - avatar
+ 3
the quiz's time is not referring to actual time. there's no need for time.sleep() also, Sololearn will kick out your code if runs for more than a few seconds...
11th Mar 2025, 1:25 AM
Bob_Li
Bob_Li - avatar
0
Actually, i removed the count down and still had issues.
11th Mar 2025, 1:28 AM
Rikk Sullenberger
Rikk Sullenberger - avatar
0
Sorry, the delay
11th Mar 2025, 1:28 AM
Rikk Sullenberger
Rikk Sullenberger - avatar