Adding Two Numbers in Python
June 24, 2020
Python is very easy computer programming language. Today you will learn how to add two numbers in Python. You will also learn hear how to take input from user and how to print output on the screen.
Python Code:
a=input('input the first number:') b=input('input the second number:') print('a+b=',int(a)+int(b))
Output of the above screen will be:
input the first number:3 input the second number:9 a+b= 12
When program will wait for first number, type a number and press ENTER, again program will wait for second number and then type the second number and press ENTER then output will be shown as above.
In this tutorial, I have shown you how to how to add two numbers in Python. Hope you have enjoyed the tutorial. If you want to get updated, like my facebook page http://www.facebook.com/freetechtrainer and stay connected.