addition program in python code example
Example 1: sum of 2 numbers in python
a = int(input("Enter first number:"))
b = int(input("Enter second number:"))
sum = a+b
print(sum)
Example 2: addition in python
#+ is the addition symbol in Python, so:
print(6 + 4)
#output: 10
Example 3: how to add 2 variables in python
var1 = 5
var2 = 5
result = var1 + var2