Learn Python Training from the Best Tutors
Search in
Let us say we are adding 2 Integers. We will require 3 variables a, b and c.
Firstly we have to take 2 integer inputs from user and store them in a and b. Next we have to add those 2 integers in c variable and finally print. Code is as follows:
a=int(input("Enter 1st integer number"))
b=int(input("Enter 2nd integer number"))
c=a+b
print("Sum of 2 numbers is",c)
If we are adding decimal numbers we have to use float in place of int.
read lessIn mathematics if you have to add 2 numbers you just assign two number in to variables and add them.
In math:
x= 5 y = 10
x+y gives the sum.
In python:
Do the similar thing and print it to the screen.
x = 5
y =10
print(x+y) #this line should print the sum of x and y.
read less
View 2 more Answers
Related Questions
What is the most encountered type of error while working on Python data frames ?
Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com
Ask a QuestionRecommended Articles
Top 5 reasons why you should learn Python
Python is one of the most popular programming languages in the world. It is general-purpose, object oriented, high-level programming language used in a number of programming fields. Python is a great programming language to learn as it will introduce you to the world of programming. If you are from the technical background...
8 Hottest IT Careers of 2014!
Whether it was the Internet Era of 90s or the Big Data Era of today, Information Technology (IT) has given birth to several lucrative career options for many. Though there will not be a “significant" increase in demand for IT professionals in 2014 as compared to 2013, a “steady” demand for IT professionals is rest assured...
Why Should you Become an IT Consultant
Information technology consultancy or Information technology consulting is a specialized field in which one can set their focus on providing advisory services to business firms on finding ways to use innovations in information technology to further their business and meet the objectives of the business. Not only does...
Make a Career in Mobile Application Programming
Almost all of us, inside the pocket, bag or on the table have a mobile phone, out of which 90% of us have a smartphone. The technology is advancing rapidly. When it comes to mobile phones, people today want much more than just making phone calls and playing games on the go. People now want instant access to all their business...
Looking for Python Training classes?
Learn from the Best Tutors on UrbanPro
Are you a Tutor or Training Institute?
Join UrbanPro Today to find students near youThe best tutors for Python Training Classes are on UrbanPro
The best Tutors for Python Training Classes are on UrbanPro