ADD TWO NUMBERS IN PYTHON

 

Program

 

# This program adds two numbers

 

# Enter the two numbers

num1 = float(input(‘Enter the first number: ‘))

num2 = float(input(‘Enter the first number: ‘))

 

# Add two numbers

sum = float(num1) + float(num2)

# Display the sum

print(‘The sum of {0} and {1} is {2}’.format(num1, num2, sum))

 

input(“Press Enter to Exit”)

 

Output