Calculator_Frivaldo, Gabriel

an anonymous user · December 06, 2021 · Python
print("Calculator by Frivaldo,Gabriel")
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.