Quantcast
Channel: The Crazy Programmer
Viewing all articles
Browse latest Browse all 761

Python Program to Add Two Numbers

$
0
0

Here you will get python program to add two numbers.

The program will first ask user to enter two numbers, calculate their sum and finally print it.

input() is an inbuilt function which is used to take input from user.

Python Program to Add Two Numbers

a = input("enter first number: ")
b = input("enter second number: ")

sum = a + b

print "sum:", sum

Output

enter first number:5
enter second number:7
sum: 12

The post Python Program to Add Two Numbers appeared first on The Crazy Programmer.


Viewing all articles
Browse latest Browse all 761

Trending Articles