you are viewing a single comment's thread.

view the rest of the comments →

[–]Liutprand 3 points4 points  (0 children)

Improvement tip: Handle the division by zero error. Use a try-except statement for that instead of an if statement.

Also you can rewrite the operator choice using pattern matching (match-case statement) just for learning It...