Answers for "how to create a calculator with python"

8

calculator code

x = input("first number")
y = input("second number")
z = input("do you want to multiply, minus, divide or add? (x,-,/,+)")

y = int(y)
x = int(x)

if z == "+":
    print (x + y)

if z == "/":
    print (x / y)

if z == "x":
    print (x * y)

if z == "-":
    print (x - y)

else:
    print("use x,-,/ or + next time!")
Posted by: Guest on June-04-2020

Code answers related to "how to create a calculator with python"

Browse Popular Code Answers by Language