Here we will build a simple calculator using python.The operations in calculator will be:

• subtraction of 2 numbers
• multiplication of 2 numbers
• division of 2 numbers
• Remainder of 2 numbers

Below is the code:

print(“select operation”)

print(“2.subtract”)
print(“3.multiply”)
print(“4.Division”)
print(“5.Reminder”)
return x+y
def subtract(x,y):
return x-y
def multiply(x,y):
return x*y
def divide(x,y):
return x/y
def remainder(x,y):
return x%y
choice = input(“input ur choice(1/2/3/4/5):”)
num1=int(input(‘enter 1st no:’))
num2=int(input(‘enter 2nd no:’))
if choice == ‘1’ :
elif choice == ‘2’ :
print(num1,”-“,num2,”=”,subtract(num1,num2))
elif choice == ‘3’  :
print(num1, “-“, num2, “=”, multiply(num1, num2))
elif choice == ‘4’:
print(num1, “-“, num2, “=”, divide(num1, num2))
elif choice == ‘5’:
print(num1, “%”, num2, “=”, remainder(num1, num2))
else:
print(“Invalid input entered”)

Output:
select operation
2.subtract
3.multiply
4.Division
5.Reminder
input ur choice(1/2/3/4/5):5
enter 1st no:80
enter 2nd no:20

80 % 20 = 0
—————-select operation