Calculator_AlceraIvanGeorge

an anonymous user · December 06, 2021 · Python
a = float(input("Enter first number: "))
b = input("Enter operator: ")
c = float(input("Enter second number: "))
if b == "+":
    print(a + c)
elif b == "-":
    print(a - c)
elif b == "*":
    print(a * c)
elif b == "/":
    print(a / c)
else:
    print("Invalid operator")

Comments

Please sign up or log in to contribute to the discussion.