Python Comparison Operator
# Operator Description Example
# == If the values of two operands are equal, then the condition becomes true. (a == b) is not true. # != If values of two operands are not equal, then condition becomes true. (a != b) is true. # > If the value of left operand is greater than the value of right operand, then condition becomes true. (a > b) is not true. # < If the value of left operand is less than the value of right operand, then condition becomes true. (a < b) is true. # >= If the value of left operand is greater than or equal to the value of right operand, then condition becomes true. (a >= b) is not true. # <= If the value of left operand is less than or equal to the value of right operand, then condition becomes true. (a <= b) is true.a=9 a=9 b=2 #Comparison Operation returns only boolean value (True/False) print (a==b) #output would be #False print (a!=b) #output would be #True print (a>b) #output would be #True print (a<b) #output would be #False print (a>=b) #output would be #True print (a<=b) #output would be #False print (a and b) |
Git Repository: https://github.com/Patelvijaykumar/Python-Tutorial
Example:- https://github.com/Patelvijaykumar/Python-Tutorial/blob/master/%233_Python_Comparison_Operators.py
Very quality post.
ReplyDeletePython Online Training
Data Science Online Training
I must appreciate you for providing such a valuable content for us. I found so many interesting stuff in your blog Helped a lot in increasing my knowledge eBay contact telefoonnummer
ReplyDelete