Write a program to Add Two Variables in Python
Python 3 Code:
1 2 3 4 5 6 7 8 9 |
# This program adds two numbers num1 = 5.5 num2 = 1.15 # Add two numbers sum = float(num1) + float(num2) # Display the sum print('The sum of {0} and {1} is {2}'.format(num1, num2, sum)) |
Output: