Python Program to Add Two Numbers #4

Share with others

Python Program to Add Two Numbers

In this program, students will understand the code of Python which will accept two numbers from the user and add them. To understand the Python Program to Add Two Numbers, students should have basic knowledge of input( ) function and print( ) function.

Once the students understand the concept of above program (Python Program to Add Two Numbers), they can easily do the following programs

  1. Python Program to subtract two numbers.
  2. Python Program to divide two numbers.
  3. Python Program to multiply two numbers.

Let we see the code of Python Program to add two numbers.

Python Program to Add Two Numbers
Python Program to Add Two Number

Line by Line explanation of above program :

  1. num1 and num2 are two variables which store the values of two integers accepted from the user
  2. Another variable result is used to store the sum of num1 and num2.
  3. Finally printing the value of result variable.

OUTPUT of above Program

Python Program to Add Two Numbers
Python Program to Add Two Number

Similarly students can write the code of division, multiplication and subtraction of two numbers

Python Program to Add Two Numbers

OUTPUT of the Above Program




MCQ of Computer Science Chapter Wise

1. Functions in Python

2. Flow of Control (Loop and Conditional statement)

3. 140+ MCQ on Introduction to Python

4. 120 MCQ on String in Python

5. 100+ MCQ on List in Python

6. 50+ MCQ on Tuple in Python

7. 100+ MCQ on Flow of Control in Python

8. 60+ MCQ on Dictionary in Python


Important Links

100 Practice Questions on Python Fundamentals

120+ MySQL Practice Questions

90+ Practice Questions on List

50+ Output based Practice Questions

100 Practice Questions on String

70 Practice Questions on Loops

70 Practice Questions on if-else


Disclaimer : I tried to give you the correct coding of ” Print Hello World in Python” , but if you feel that there is/are mistakes in the code or explanation of “Print Hello World in Python “ given above, you can directly contact me at csiplearninghub@gmail.com.


Share with others

Leave a Reply

error: Content is protected !!