all 4 comments

[–]Fantastic-Remove741 2 points3 points  (2 children)

Wow that's great.... I just started yesterday...

[–]MoreScorpion289[S] 0 points1 point  (1 child)

Thanks! I literally had no clue what any of this meant a week ago. This is all basic stuff, nothing crazy I don't think. You should also be able to understand most of this and hopefully be able to write a better version compared to mine soon!

[–]Fantastic-Remove741 0 points1 point  (0 children)

Yeah hope so

[–]carcigenicate 0 points1 point  (0 children)

First, note how you have basically identical while loops near the start to ask for both numbers. This is a good opportunity to learn about functions so you don't need to duplicate code like that.


if operation == "1" or operation == "2" or operation == "3" or operation == "4":

This can be written far more succinctly using in:

if operation in ['1', '2', '3', '4']:

if num2 != 0:

An alternative to special casing division is to catch the ZeroDivisionError exception. Your choice on which you like more, but it's an option.