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
- Python Program to subtract two numbers.
- Python Program to divide two numbers.
- Python Program to multiply two numbers.
Let we see the code of Python Program to add two numbers.
Line by Line explanation of above program :
- num1 and num2 are two variables which store the values of two integers accepted from the user
- Another variable result is used to store the sum of num1 and num2.
- Finally printing the value of result variable.
OUTPUT of above Program
Similarly students can write the code of division, multiplication and subtraction of two numbers
OUTPUT of the Above Program
MCQ of Computer Science Chapter Wise
2. Flow of Control (Loop and Conditional statement)
3. 140+ MCQ on Introduction to Python
4. 120 MCQ on String in Python
7. 100+ MCQ on Flow of Control in Python
8. 60+ MCQ on Dictionary in Python
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 firstname.lastname@example.org.