Posts

Showing posts with the label Python Operator/ Comparison operator in Python

Python Operator

 Python Operator 2. Comparison operator: Define:   The operator or symbol that is used to compare two or more values. It returns the results as true or false. It is used for condition and decision-making. The symbols are : = = ,  > ,  < ,  > = ,   < = ,  and  != . Some examples are as follows: a = 12 b = 10 == If we write to compare the above two variables as a==b, it will return false because 12 and 10 are not equal. >   This operator is 'is greater'. This operator checks that the first value is greater than the second. As a > b , it will return true because 12 is greater than 10. < This operator is 'is less than'. This operator checks that the first value is less than the second. As a < b , it will return true because 12 is greater than 10. > = This operator is the combination of two symbols > and =. This operation is solved in two steps. If one condition is true, it will return true as a whole. Otherwise ...