Contents
Python Addition – Arithmetic Operator
Python Addition Operator is used to find the sum of given two numbers.
Addition Operator takes the two numbers as inputs, one on the left, and the other on the right, and returns the sum of the these two numbers.
The symbol used for Python Addition operator is +.
Syntax
The syntax of Python Addition Arithmetic Operator with the inputs is given below.
result = operand_1 + operand_2
where operand_1 and operand_2 are numbers and the result is the sum of operand_1 and operand_2.
1. Addition of two integer numbers
In this example, we shall take two integers, add them, and print the result.
Output
22
2. Chaining of Addition Operator
You can add more than two numbers in a single statement. This is because, Addition Operator supports chaining.
Output
90
3. Addition of Floating Point Numbers
Float is one of the numeric datatypes. You can compute the sum of floating point numbers using Python Addition operator. In the following example program, we shall initialize two floating point numbers, and find their sum.
Output
23.4
4. Addition of Complex Numbers
You can find the sum of complex numbers. In the following example program, we shall take two complex numbers and find their sum.
Output
(4+13j)
Summary
In this tutorial of Python Examples, we learned what Python Addition Arithmetic Operator is, how to use it to find the sum of two or more numbers.