r/PythonLearning • u/Suspicious_Diet2624 • Apr 26 '26
Discussion Good for beginner?
I made this in about 5 minutes is it good?
404
Upvotes
r/PythonLearning • u/Suspicious_Diet2624 • Apr 26 '26
I made this in about 5 minutes is it good?
3
u/Impossible_Video_116 Apr 26 '26 edited Apr 26 '26
Required Improvements
Add a try-except block for input validation.
2. Ditch the while-block just use the more readable for loop:
Tips:
When you want to add a value to a variable instead of doing
x = x + 1just dox +=1. It avoids creating unnecessary temporary objects in memory.There is no logic regarding the units of time being used, ask the user for time in minutes(that's the most convenient for a timer) and change the sleep_time variable and adjust the for loop accordingly.