0% found this document useful (0 votes)
2 views28 pages

Comp-02 Ch1 Python Operators

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

Comp-02 Ch1 Python Operators

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

PYTHON

LESSON:
PYTHON OPERATORS

✓ Types of Python Operators


PYTHON OPERATORS
• Here's a list of different types of Python operators that we will
learn in this tutorial.

[Link] Operators
[Link] Operators
[Link] Operators
[Link] Operators
[Link] Operators
[Link] Operators
ARITHMETIC
OPERATORS
• Python comes with an extensive standard library of modules.
A module is previously written code that can be imported in a
program.
• The import statement defines a variable for accessing code in a
module. Import statements often appear at the beginning of a
program.
ASSIGNMENT
OPERATORS
Assignment operators are used to assign values to variables.
For example,

Here, = is an assignment operator that assigns 5 to x.


COMPARISON
OPERATORS
Comparison operators compare two values/variables and
return a boolean result: True or False. For example,

Here, the > comparison operator is used to compare whether a is


greater than b or not.
LOGICAL
OPERATORS
Logical operators are used to check whether an expression
is True or False. They are used in decision-making. For example,

Here, and is the logical operator AND. Since both a > 2 and b >=
6 are True, the result is True.

You might also like