Python Program to Add Two Numbers
- Jino Shaji
- Jan 11, 2015
- 1 min read
Updated: Jun 9, 2020
Source Code to Add Two Numbers
#Program to add two numbers num1 and num2
#Author : Jino Shaji
num1 = input('Enter first number: ')
num2 = input('Enter second number: ')
#Add num1 and num2
sum = float(num1) + float(num2)
# Display the sum
print('The sum of {0} and {1} is {2}'.format(num1,num2,sum))
Output
Enter first number: 45
Enter second number: 20
The sum of 45 and 20 is 65.0
댓글