In this blog post, I will share how to make the Calculator program in Python. I hope You will get your perfect solution in this blog post. Now describing below how to make Calculator Program in Python.
def add(x,y):
return x+y
def subtract(x,y):
returnx-y
def multiply(x,y):
return x*y
def add(x,y):
returnx/y
print(“Select operation.”)
print(“1.Add”)
print(“2.Subtract”)
print(“3.Multiply”)
print(“Divid&”)
choice= input(“Enter choice(1/2/3/4)”)
numi= int(input(“Enter fast number:”))
num2= int(input(“Enter second number”))
if choice ==’1′:
print(numl,”+”,num2,”=”,add(numl,num2))
elif choice ==’2′:
print(numl,”-“,num2,”=”,subtract(numl,num2))
elif choice ==’3′:
print(numl,”***”,num2,”=”,multiply(numl,num2))
elif choice ==’4′:
print(num-1,”/”,num2,”=”,divide(numl,num2))
else:
print(“You press Invalid input”)
Output:
Select operation.
- Add
- Subtract
- Multiply
- Divide
Enter choice(1/2/3/4):3
Enter the fast number: 35
Enter second number: 3
35*3 = 150
Output Proved:

I am Joseph D. Moyer. I am the founder of virtualworldtechnology.com. I am a technology specialist. I am a professional blogger, SEO Expert, and also an expert in social media marketing as well as internet marketing too. Continue here my Experience on This Blog.