Python

Addition of two numbers in Python

#user defined addition of two numbers

x = int(input("Enter the value for number1\n"))
y = int(input("Enter the value for number2\n"))

#adding two numbers
sum = x + y

#Printing the sum
print('The sum of {0} and {1} is {2}'.format(x, y, sum))

Output

Enter the value for number1
5
Enter the value for number1
6
The sum of 5 and 6 is 11

About the author

Castro K Joseph

Leave a Comment