InterviewSolution
Saved Bookmarks
| 1. |
Program Flow Control in Python |
||||||||||||||
|
Answer» Relational Operators in Python The Table gives a list of relational operators available in Python along with their functions:
Some examples are given below: # Equality Operator>>> 10 == 10 True # 10 is equal to 10, so true >>> 10 == "10" False # The first string is of type int, 2nd of type string, so false. # Greater than >>> 10 > 20 False # 10 is lesser than 20, so above expression is false. # Inequality >>> 10 != 20 True # 10 is not equal to 20, so the expression is true # Greater than or equal to >>> (2 + 3) >= (4 + 1) True # (2 + 3) = 5 and (4 + 1) = 5, so the expression is true. >>> True is False False >>> True is not False True |
|||||||||||||||