Write A Python Program To Implement A Calculator To Do Basic Operations Like(+, -, *, /).
January 31, 2023 by Primegyan 3.24k
Question: Write a Python program to implement a calculator to do basic operations Like(+, -, *, /).
Solution:
n1=int(input("Enter first numbers"))
n2=int(input("Enter second numbers"))
op=input("Enter the operation +,-,*,/ : ")
if op=='+':
print(n1+n2)
elif op=='-':
print(n1-n2)
elif op=='*':
print(n1*n2)
elif op=='/':
print(n1/n2)
else:
print("Invalid entry!!")
OUTPUT:
Enter first numbers25
Enter second numbers41
Enter the operation +,-,*,/ : *
1025
Video Solution for Python program to implement a calculator to do basic operations: Click Here