-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path05 - RELATIONAL OR LOGICAL OPERATORS
More file actions
30 lines (23 loc) · 1.06 KB
/
05 - RELATIONAL OR LOGICAL OPERATORS
File metadata and controls
30 lines (23 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Relational or Logical Operators:
the relational operators available in python are followed:
1. > - greater than
2. < - lesser than
3. >= - greater than equal to
4. <= - less than equal to
5. == - equal to
6. != - not equal to
So the result of an relation operation is a boolean value (that is , either True or False)
NOTE : >= and <= should not be writtern as => or =< these are invalide
and double equal to (==) is different from single equal to (=)
= - is an assignment operator were as == - is a relational operator
EXANPLES:
1. 4 > 5 - False
2. 5 < 100 - True
3. 10 == 11 - False
4. 5 == 5 - True
5. 10 != 11 - True
6. 5 != 5 - False
7. 'name' == 'Name' - False
8. 'A' != 'a' - True
so these are the basic relation operators avilable in python and these are mainly used in conditional statements (if-elif-else) and looping statements(for , while loops)
youtube tutorial video is available in youtube and link is in readmefile