Home >>Python Programs >Python program to do arithmetical operations
The arithmetic operations are basically the numeric calculations which are performed by calculator where we can perform different operations like addition, subtraction, multiplication and division.
In this example we will show you the basic arithmetic operations like:
# Input numbers:
num1 = 15
num2 = 25
# Add two numbers
sum = float(num1) + float(num2)
# Subtract two numbers
min = float(num1) - float(num2)
# Multiply two numbers
mul = float(num1) * float(num2)
#Divide two numbers
div = float(num1) / float(num2)
# Display the sum
print('The sum of {0} and {1} is {2}'.format(num1, num2, sum))
# Display the subtraction
print('The subtraction of {0} and {1} is {2}'.format(num1, num2, min))
# Display the multiplication
print('The multiplication of {0} and {1} is {2}'.format(num1, num2, mul))
# Display the division
print('The division of {0} and {1} is {2}'.format(num1, num2, div))