r/PythonLearning • • 1d ago

Is this suitable for beginners?

Post image
3 Upvotes

1 comment sorted by

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 - 1 can be replaced by 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.

  • wrapping the int() inside a try/except block can help incase an invalid data is input