Read Python Interview Questions and Answers for Beginners and Experienced

Python add two number example

In this Python example , we will study Python add two number example. In this python tutorial, we will study very basic example that how we can add two numbers in Python programming.


#Python add two number Example

number1=10
number2=12.25

sum=number1+number2

print("Addition of two number is:",sum)

 

Addition of two number is 22.25

 

Explanation

  • number1 is integer number
  • number2 is decimal number
  • addition can be done using plus operator +  in Python.

In python, if we use the plus + sign between two Strings, they will concatenate as we study in Python Strings concatenation example, and if we apply the plus operator between two numbers, numbers will add.