⊕
⊖
Contents
Python Program to Find Sum of Two Numbers
To find sum of two numbers in Python, you can use Arithmetic Addition Operator +.
+ operator takes two operands and returns the sum of the two numbers.
1. Sum of Two Integers
In this example, we shall take two integers and find their sum. Following are the steps we shall implement.
- Start.
- Take two numbers in n1, n2.
- Compute sum of the two numbers.
- Stop.
Output
Sum = 28
2. Sum of two Floating Point Numbers
You can use the same steps to find the sum of two floating point numbers. In this example, we shall read two floating point numbers and find their sum.
Output
Sum = 1.77
Summary
In this tutorial, we learned how to find sum of two numbers in Python using Addition operator, with the help of example programs.
Next Topic ⫸ Python - Sum of first N natural numbers
⫷ Previous Topic Python - Star pattern programs