code to make calculator in python code example
Example 1: 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!")
Example 2: calculator in python
def mutiply (x):
return _*x
o = mutiply(_)
print(o)