In comparison operator most of the time you will find the
result in Boolean expression (or logical expression) because the evaluates one
of two states as true or false. These operators compare the values on either
sides of them and decide the relation among them. They are also called
Relational operators. Use of Comparison Operator in Python.
Kindly find the below symbols to compare the values.
Suppose you have two variables
a and b, a holds the value as 20 and b holds the value as 30:
== equal to this
is used to compare two values .This is
will check if value of two operands are equal then only this will return
true otherwise this will return as false.
a==b
>>false
< less then This will check if the value of left operand
is less than the value of right operand
then condition become true otherwise this will return as false .
a<b
>> true
>greater then This will check if the value of
right operand is greater than the value of
left operand then condition become true otherwise this will return the result as false .
a>b
If you want to read more about Python visit on Softcrayons
website.
No comments:
Post a Comment