Add Two Numbers in Python

Add two numbers using different ways in Python programming and print the sum on the output screen. In this tutorial, you can learn how to add two numbers.

Program Adding Numbers

Program

print(5 + 6) #it printing 11.
Output
11

Program Adding Numbers Another Method

Program

a = 5 #assigning 5 to 'a'.
b = 6 #assigning 6 to 'b'.
c = a + b #adding 'a' and 'b' values and assigning to 'c'.
print(c) #printing 'c' value, U also write like 'print(a + b)'.
Output
11

Program Assigning Multiple Numbers and Adding

Program

a, b, c = 1, 2, 3 #assigning values to 'a','b' and 'c'.
print(a + b + c) #and printing.
Output
6

Program Printing Power of Value
Program

a = pow(2, 3) #2 power 3 assigning to 'a'.
print(a) #and printing.
Output
8