Answers for "Create a simple calculator in any language of your choice. Consider only addition, subtraction, multiplication and division operations. Take input from the user as a string. as - Input - (20 * (30 + 10) / (10 * 2)) should print out 40."

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 "Create a simple calculator in any language of your choice. Consider only addition, subtraction, multiplication and division operations. Take input from the user as a string. as - Input - (20 * (30 + 10) / (10 * 2)) should print out 40."

Python Answers by Framework

Browse Popular Code Answers by Language