HOME/Articles/

SumTwoNumbers (snippet)

Article Outline

Python example 'SumTwoNumbers'

SumTwoNumbers

Python beginners example: SumTwoNumbers

#Python Program for adding two numbers
num1 = input("Enter first number: ")
num2 = input("Enter second number: ")

#Treating numbers as integers
sum = int(num1) + int(num2)

print("The sum is : {0}".format(sum))