I need help | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

I need help

Ok so I found the simple solution. That's simply subtracting 3 to get 9 from 12. But I wanted a better approach. I want it to count down from 12. 12 11 10 9 (prints answer) Link below https://code.sololearn.com/cMcOsHPcQ6vr/?ref=app

6th Jul 2019, 12:04 AM
Kidale Smith
Kidale Smith - avatar
2 Answers
+ 2
time = 12 for i in range(time, -1, -1): # 12, 11, 10, ..., 1, 0 print(i) if i == 9: print("Alarm will go off") break
6th Jul 2019, 12:22 AM
Diego
Diego - avatar
+ 1
Usama Bin Mamun come on coach 🙏🏿
9th Jul 2019, 8:53 PM
Kidale Smith
Kidale Smith - avatar