Answers for "how to store calculator numbers in python"

6

python calculator

num_one = int(input("Enter 1st number: "))

op = input("Enter operator: ")

num_two = int(input("Enter 2nd number: "))

if op == "+":
    print(num_one + num_two)
elif op == "-":
    print(num_one - num_two)
elif op == "*" or op == "x":
    print(num_one * num_two)
elif op == "/":
    print(num_one / num_two)
Posted by: Guest on August-01-2020

Code answers related to "how to store calculator numbers in python"

Python Answers by Framework

Browse Popular Code Answers by Language