0% found this document useful (0 votes)
3 views4 pages

Python Lesson 2

This document outlines Python Lesson 2, focusing on arithmetic, comparison, and logical operators. It provides examples of comparison operators with expected results and highlights the use of logical operators like AND, OR, and NOT. Additionally, it includes an exercise for practice.

Uploaded by

lynnyeyintthant
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)
3 views4 pages

Python Lesson 2

This document outlines Python Lesson 2, focusing on arithmetic, comparison, and logical operators. It provides examples of comparison operators with expected results and highlights the use of logical operators like AND, OR, and NOT. Additionally, it includes an exercise for practice.

Uploaded by

lynnyeyintthant
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 2

Step 1. Arithmetic Operator

Try this in shell


Step 2. Comparison Operator

> Greater than

< Less than

>= greater than or equal to

<=less than or equal to

== equal to

!= not equal to

Type this in shell, you should get expected result as output.

Comparison Expected Result


5>3 True
3>5 True
5<10 True
10<3 False
5>=4 True
5>=5 True
4<=7 True
4<=4 True
5<=3 False
5==5 True
3==5 False
5!=4 True
5!=5 Flase
6!=”six” False (“six” is considered
string)
20!=”20” False (because “20” is
considered string)
Step 3. Logical Operator

AND OR NOT

Step 4. Exercise

You might also like