A simple calculator for simple people. Without a calculator, i don't know what i would do in math. Probably fail...
Division by zero error, I reccomend putting a try function to prevent errors from appearing and messing up the script.
try: choice = input("Enter choice(1/2/3/4): ") num1 = float(input("Enter first number: ")) num2 = float(input("Enter second number: ")) if choice == '1': print(num1,"+",num2,"=", add(num1,num2)) elif choice == '2': print(num1,"-",num2,"=", subtract(num1,num2)) elif choice == '3': print(num1,"*",num2,"=", multiply(num1,num2)) elif choice == '4': print(num1,"/",num2,"=", divide(num1,num2)) else: print("Invalid input") except: print("An error occured!")
@AlexRamirez2 Wow, thanks! I will put that in right now!
@Alexramirez2 I think that i fixed it. Thanks again!
@AlexRamirez2 Okay!
Calculator
A simple calculator for simple people. Without a calculator, i don't know what i would do in math. Probably fail...
Division by zero error, I reccomend putting a try function to prevent errors from appearing and messing up the script.
@AlexRamirez2 Wow, thanks! I will put that in right now!
@Alexramirez2 I think that i fixed it. Thanks again!
@AlexRamirez2 Okay!