UrbanPro

Learn Python Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

How do I print and add 2 numbers in Python?

Asked by Last Modified  

4 Answers

Learn Python

Follow 4
Answer

Please enter your answer

Music Training professional with 6 years of online/offline teaching experience

def add_number(a,b): print (a,b) return a+b
Comments

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...
read more

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 less
Comments

4½ years of expertise in class-7-10 and full stack development tutoring

Comments

Programming Trainer and Software Engineer having 10 years of experience

In 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 more

In 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
Comments

View 2 more Answers

Related Questions

What are the future career opportunities after Python certification courses?

You can go for many career paths depending upon your interest. The most prominent of them are as follows: Python developer for automation Data Analyst ETL developer Web-Application Developer Machine Learning Expert Data Scientist Data Engineer
Rajnish
Where is a good place to learn Python?
leetcode, hackerrank, w3school
Srikanth

I have passed Btech Electronics and Communication in 2015 and as you all know in ECE there is little knowledge of programming. And i want to learn Python from scratch. How much time it'll take to get a job after learning Python.

For Python, ideally, it takes two months for completing the syllabus. Then it needs practice. B.Tech Electronics with no computer science background can also learn python. It does not require additional...
Arun
While teaching IT Student (MCA / BCA / BTech), I found most of the students are not having good programming skills but they are still running behind to learn .NET / PHP / PYTHON / ANDROID / JAVA. Why is it so? What we should do better to improve a sound programming skills among most of IT Students?
on college days they r learning c,c++ and following faculties are also giving a road map of "programming means" thease languages only , even these are the languages are familier , where you justify them...
Amit Kumar
Can I build iPhone apps using Python?
Yes, you can use PyMob app where apps can be written purely in Python, and the compiler tool flow converts them in native source codes for various platforms. But there are some cons on using PyMob, the...
Sunil
0 0
5

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons


Personalise touch of training & learning
We all are in countinous learning phase in life. Day to day we are learning new things,new language words,new faces,new gazets by all means of modes like reading books,newspapers,watching TV,movies,meeting...
S

Smartnub Softsolutions

0 0
0

What is a generator?
A generator is a function that has one or more yield statements. Example: >>>def gen_demo(a): yield a a = a+10 yield a a = a+30 yield a >>>gen_a...

Using Lambda and Filter with Regular expressions.
1) Start the Python interpreter and import the re module: >>> import re 2)Define a tuple strings to filter with regular expressions: t=('python','pycon','perl','peril','step','stop','come','came','exercise','hello','storm','my.mail','year','yam') ...

Black in Python
When you are upturn in your career from beginner to experienced in programming world, your team will start looking at ‘how you are writing?’ Here the responsibility piling up. Okay,...

Recommended Articles

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...

Read full article >

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...

Read full article >

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...

Read full article >

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...

Read full article >

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 you
X

Looking for Python Training Classes?

The best tutors for Python Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Python Training with the Best Tutors

The best Tutors for Python Training Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more