Addition-Multiplication-subtraction-and-Division-in-Python

Addition, Multiplication, Subtraction and Division in Python

If you are learning Python, and  you are a beginner,  after making Hello world program  in Python.

You should perform basic computations like  addition, multiplication, subtraction and division.

Addition of Two Numbers in Python-

See the program for addition of two numbers.

Output would be 16

In the above code

a refers to 12 i.e. wherever a will be used value is 12.

b refers to 4 i.e. wherever 4 will be used value is 4.

c refers addition of a and b i.e. 16.

print(c) statement will send value of c on the standard output screen.

Multiplication  of Two Numbers in Python-

To multiply a and b in the above program replace a+b by a*b, see the below program.

Subtraction of a Number from Another Number in Python-

To subtract  b from a, in the above program replace a*b by a-b, see the below program.

Output would be 8.

Division of a Number by Another Number in Python-

To divide  a by b, in the above program replace a-b by a/b, see the below program.

The output would be 3.

In the video given below every thing is explained, watch the video.

 

 

 

Leave a Comment

Your email address will not be published. Required fields are marked *

©Postnetwork-All rights reserved.