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