0
I am beginner,This is will be right code?
https://sololearn.com/compiler-playground/cTYkxjakBSFj/?ref=app
1 Resposta
+ 3
Your code is mostly correct and works fine, but here are some improvements you can make.
Add input validation, your code doesn't handle invalid inputs (like numbers outside 0–24 or non-numeric values). Add a check to ensure the input is valid using try and except. Handle edge cases, the current code assumes that 0 is evening, but you may want to handle 0 explicitly, especially for time formats. Also, simplify conditions for better readability by chaining comparisons with <= operator in python.