MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/PythonLearning/comments/1y14m3t/is_this_suitable_for_beginners/
r/PythonLearning • u/Esaiasilence • 1d ago
1 comment sorted by
1
Yuppp Some improvement i would make is
Putting if time_start == time_end : inside the loop is unnecessary as the loop already has this as condition. You can put the output outside the loop.
if time_start == time_end :
time_start = time_start - 1 can be replaced by time_start -= 1
time_start = time_start - 1
time_start -= 1
You can put print(time_start) at the start of your loop so that it includes the value you're starting from.
print(time_start)
wrapping the int() inside a try/except block can help incase an invalid data is input
1
u/Due-Mortgage-6854 1d ago
Yuppp Some improvement i would make is
Putting
if time_start == time_end :inside the loop is unnecessary as the loop already has this as condition. You can put the output outside the loop.time_start = time_start - 1can be replaced bytime_start -= 1You can put
print(time_start)at the start of your loop so that it includes the value you're starting from.wrapping the int() inside a try/except block can help incase an invalid data is input