Important Notice:

Course Content
Operators, Expression & Python Statement (Chapter-4) M3-R5.1
About Lesson
  1. Addition Operator :

num1 = 7

num2 = 3

#using the addition operator

result = num1+num2

print(result)

                        Output :               10

  1. Subtraction Operator :

num1 = 7

num2 = 3

#using the subtraction operator

result = num1-num2

print(result)

                        Output :               4

  1. Multiplication Operator :

num1 = 7

num2 = 3

#using the multiplication operator

result = num1*num2

print(result)

            Output :               21

  1. Division Operator :

num1 = 7

num2 = 2

#using the Division operator

result = num1/num2

print(result)

            Output :               3.5

  1. Modulus Operator :

num1 = 7

num2 = 3

#using the Modulus operator

result = num1%num2

print(result)

Output :               1

  1. Exponentiation Operator :

num1 = 7

num2 = 2

#using the Exponential operator

result = num1**num2

print(result)

Output :       49

  1. Floor division :

num1 = 7

num2 = 2

#using the Floor division operator

result = num1//num2

print(result)

Output :               3

 

A= 5

B= 2

print(“Addition :  “, A+B)

print(“Subtraction :  “, A-B)

print(“Multiplication :  “, A*B)

print(“Division :  “, A/B)

print(“Modulus :  ” , A%B)

print(“Exponentiation :  “, A**B)

print(“Floor division :  “, A//B)

 

Output

Addition :   7

Subtraction :   3

Multiplication :   10

Division :   2.5

Modulus :   1

Exponentiation :   25

Floor division :   2

 

 

 

 

 

 

 

 

error: Content is protected !!