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