,

Python Program to Add Two Numbers


Python Program to Add Two Numbers


 val1 = 100.99
 val2 = 76.15

 # Adding the two given numbers
 sum = float(val1) + float(val2)

 # Displaying the addition result
 print("The sum of given numbers is: ", sum)

Output:

 The sum of given numbers is:  177.14


Example: Getting input from user

 #getting input from user
 val1 = input("Enter any number: ")
 val2 = input("Enter any number: ")

 # Adding the two given numbers
 sum = float(val1) + float(val2)

 # Displaying the addition result
 print("The sum of given numbers is: ", sum)

Output:

 Enter any number: 20
 Enter any number: 35
 The sum of given numbers is:  55.0