Python program to add to numbers
# Program to add two numbers entered by the user
# Take input from the user
num1 = input("Enter the first number: ")
num2 = input("Enter the second number: ")
# Convert inputs to float (to support decimals)
sum = float(num1) + float(num2)
# Display the result
print("The sum of {0} and {1} is {2}".format(num1, num2, sum))
Comments
Post a Comment