Mathematical Operators- Python

By: Dynasty William

What is an Operator?

  • Operators are the constructs which can manipulate the value of operands(operand~the quantity on which an operation is to be done.)
*****************************************************************

Ex.) Consider the expression 4 + 5 = 9. Here, 4 and 5 are called operands and + is called operator.


Different Kinds Operators

If a variable is included in a number calculation you should remember:

  • Variables go on the left side of the operator
  • Calculation goes on the right of the operator
EX.) 3 * x

Subtraction(-):

x = 4

y = 5

z = 6

print x - z


Output- -2

***************************************************************

Multiplication(*):

x = 4

y = 5

z = 6

print z * 3


Output- 18

***************************************************************

Addition(+):

x = 4

y = 5

z = 6

print x + y


Output- 9



Division(/):

x = 4

y = 5

z = 6

print z / x


Output- 1




Modulus(%):

x = 4

y = 5

z = 6

print z % y


Output- 1


***************************************************************

Negative number(-x):

x = 4

y = 5

z = 6

print -x


Output- -4

***************************************************************

Exponent(**):

x = 4

y = 5

z = 6

print y ** x


Output- 625

Create a presentation like this one
Share it on social medias
Share it on your own
Share it on social medias
Share it on your own

How to export your presentation

Please use Google Chrome to obtain the best export results.


How to export your presentation

New presentation

by dynastywilliam

8 views

Public - 10/17/16, 6:02 PM