Python
Course Instructor: Sir Atique Ahmed
Learning Objectives
By the end of this class, students will be able to:
•Understand Operators use in python.
•Will be able to logical programs
Course Instructor: Sir Atique Ahmed
Arithemetic Operator
Used for basic maths operations
Operator Description Example Output
+ Addition 5+3 8
- Subtraction 5-2 3
* Multiplication 4*2 8
/ Division 10 / 2 5.0
// Floor Division 7 // 2 3
% Modulus 7%3 1
** Exponent 2 ** 3 8
Course Instructor: Sir Atique Ahmed
Relational ( Comparision ) Operator
Used to compare two values.
Operator Description Example Output
== Equal to 5 == 5 True
!= Not equal to 5 != 3 True
> Greater than 7>3 True
< Less than 2<4 True
Greater or
>= 5 >= 5 True
equal
<= Less or equal 4 <= 3 False
Operator Description Example Output
Course Instructor: Sir Atique Ahmed
Logical Operator
Used to combine conditions.
Operator Description Example Output
True and
and True if both False
False
True if True or
or True
either False
Reverses
not not True False
logic
Course Instructor: Sir Atique Ahmed
Assignment Operator
Used to assign values to variables.
Operator Example Equivalent To Operator
= x=5 x=5 =
+= x += 3 x=x+3 +=
-= x -= 2 x=x-2 -=
*= x *= 4 x=x*4 *=
/= x /= 2 x=x/2 /=
= x=5 x=5 =
Course Instructor: Sir Atique Ahmed
Order of Operations ( PEMDAS Rule )
Used PEMDAS to remember order.
•P: Parentheses ()
•E: Exponents **
•M/D: Multiplication / Division
•A/S: Addition / Subtraction
Course Instructor: Sir Atique Ahmed
ThanK you !!!!!!!!!!!!!!!!!!!!!!!