Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to make a calculator in python

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)
Source by github.com #
 
PREVIOUS NEXT
Tagged: #calculator #python
ADD COMMENT
Topic
Name
7+8 =