PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# creating a simple calculator
inputs = input().split()
num1 = int(inputs[0])
num2 = int(inputs[1])
# use 1 for addition
# 2 for subtraction
# 3 for division
# 4 for multiplication
# 5 for exponential
# 6 for modular division
user = int(inputs[2])
if user == 1:
print(num1 + num2)
elif user == 2:
print(num1 - num2)
elif user == 3:
print(num1 / num2)
elif user == 4:
print(num1 * num2)
elif user == 5:
print(num1 ** num2)
elif user == 6:
print(num1 // num2)
OUTPUT
Run