top of page

Python Program to Add Two Numbers

  • Writer: Jino Shaji
    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 

Recent Posts

See All
Program to Create an investment report.

“””Program: investment.py Author: JINO SHAJI Compute an investment report. 1. The inputs are        starting investment amount       ...

 
 
 

댓글


bottom of page