Can any one give me count down code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can any one give me count down code?

My code aren't working!

26th Apr 2023, 5:38 AM
Otaku
Otaku - avatar
12 Answers
+ 11
Otaku , > to get the code run, it has to be *formated properly* > using sleep() is *NOT* supported in sololearn playground > to use sleep() we need to import time module > the code then is doing the countdown, and printing "happy new year" in each loop cycle. if it should print the output only once when the countdown is finished, move it outside the loop.
26th Apr 2023, 6:22 AM
Lothar
Lothar - avatar
+ 8
Hi Otaku, we need more information to help you. As Yasin wrote, can we see a code? Can you please also read these and maybe update your question. https://www.sololearn.com/discuss/3021159/?ref=app https://code.sololearn.com/W3uiji9X28C1/?ref=app https://code.sololearn.com/Wek0V1MyIR2r/?ref=app
26th Apr 2023, 5:45 AM
Ausgrindtube
Ausgrindtube - avatar
+ 5
Otaku Share your code
26th Apr 2023, 5:39 AM
Yasin Rahnaward
Yasin Rahnaward - avatar
+ 1
for seconds in range(10, 0, -1):print(seconds) time.sleep(1) print("happy new year")
26th Apr 2023, 5:45 AM
Otaku
Otaku - avatar
+ 1
Hello! As Ausgrindtube said, read those links and upload your code to your question, so we can answer your question
26th Apr 2023, 5:55 AM
Ugulberto Sánchez
Ugulberto Sánchez - avatar
+ 1
Ok
26th Apr 2023, 6:00 AM
Otaku
Otaku - avatar
+ 1
Share your code using code playground
26th Apr 2023, 9:07 AM
Hasnain [ACTIVE CHALLENGER]
Hasnain [ACTIVE CHALLENGER] - avatar
+ 1
import time -> have you imported time??? for seconds in range(10, 0, -1): print(seconds) time.sleep(1) print(“happy new year”)
26th Apr 2023, 10:18 AM
Ugulberto Sánchez
Ugulberto Sánchez - avatar
+ 1
Sony Hossain this is not what otaku was asking for
26th Apr 2023, 3:35 PM
Ugulberto Sánchez
Ugulberto Sánchez - avatar
+ 1
Yeah I got it previously but if you go for the customization process a bit of.. it could be the expected one! Thanks..
26th Apr 2023, 3:40 PM
Sony
Sony - avatar
0
https://code.sololearn.com/cafaWDq2ham0/?ref=app https://code.sololearn.com/c9Hbjq158lNv/?ref=app
27th Apr 2023, 7:26 AM
Welcome To Dodgeball
Welcome To Dodgeball - avatar