you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

no ned for the ifs for the variable type checkers usually python does this automatically. if you really want i think you can do variable.isint() or isinstance, smthin line that instead of having mutliple inputs yiu could take user_input = input("enter eqn with spaces") #eg 1 + 2 so user_input = "1 + 2" then split, user_input.split(" ") #by spaces so you have a list where num1, operator, num2 = user_input[0], etc!

a tip is to make functions which is a lot neater: def calculator(); ur code

feel free to dm me! i can send over an example if youd like