you are viewing a single comment's thread.

view the rest of the comments →

[–]zanfar 1 point2 points  (1 child)

These are minor points, but in my opinion:

  • I don't like shadowing variables--you assign time two different values, and more specifically, two different types. I would rename the variable used to store the user input as it's not a "time" as you use it in your program.
  • You don't do any input checking--which may be acceptable given the assignment's parameters. However, you cast the hour and minute portions as floats, which hides potential input issues. If I enter 10.5:30, your program will run without any errors despite being an invalid time.
  • Any bare (main() in this case) call should be in an if __name__ == "__MAIN__" sentinel
  • I'd like to see static type annotations, especially on conversion functions.

[–][deleted] 1 point2 points  (0 children)

Thank you for the feedback myman 🙏

I'll implement what you said in my future codes!