0% found this document useful (0 votes)
5 views8 pages

Lecture # 3 Python

The document outlines a Python course taught by Sir Atique Ahmed, focusing on operators and their usage. It covers arithmetic, relational, logical, and assignment operators, along with the order of operations using the PEMDAS rule. By the end of the course, students are expected to understand these concepts and be able to write logical programs.

Uploaded by

mahamchishti08
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views8 pages

Lecture # 3 Python

The document outlines a Python course taught by Sir Atique Ahmed, focusing on operators and their usage. It covers arithmetic, relational, logical, and assignment operators, along with the order of operations using the PEMDAS rule. By the end of the course, students are expected to understand these concepts and be able to write logical programs.

Uploaded by

mahamchishti08
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

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

You might also like