Given two numbers num1 and num2. The task is to write a Python program to find the addition of these two numbers.
Input: num1 = 5, num2 = 3 Output: 8 Input: num1 = 13, num2 = 6 Output: 19
In the below program to add two numbers, the user is first asked to enter two numbers and the input is scanned using the input() function and stored in the variables number1 and number2. Then, the variables number1 and number2 are added using the arithmetic operator + and the result is stored in the variable sum.
Below is the Python program to add two numbers:
Sum of 15 and 12 is 27
Example 2: Adding two number provided by user input
First number: 13.5 Second number: 1.54 The sum of 13.5 and 1.54 is 15.04
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.