+ 1
How to make this code more elegant/pythonic?
Hi everyone! Other than basic exercises, this is my first program! I feel good about it, and Iâve tested that it works. However, it feels inelegant and long. Does anyone have suggestions where it could be improved? Also, it doesnât validate againt unexpected input so youâll need 2 inputs to run: 1) an hour of day in the format â7 AMâ or â11 PMâ (AM and PM in caps and separated from number by one space) and 2) a positive number such as 3 or 548. https://code.sololearn.com/cSg2c57S3O7J/?ref=app
3 Answers
+ 1
wow! That code really makes me feel good because it shows that I did get a lot right while also giving me some concrete things to improve and learn more about.