1. Home
  2. Python
  3. Python Examples
  4. Python – Add Two Numbers

Python – Add Two Numbers

Python Program to Add Two Numbers

Write a Python program take input of two numbers and calculate sum of two numbers.

This program will prompt user to input two numbers on standard input. Then calculate sum of two numbers a print sum of both values on standards output.

Example:

The following Python program uses input() function to take input of 2 number from user. Calculate the sum and use print() function to print result.

Execute this program:

Enter first number: 10
Enter second number: 5
Sum of input numbers is: 15
Tags
Was this article helpful to you? Yes 1 No
Advertisement