Thursday, June 6, 2019

Python Comparison Operator

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)



2 comments:

  1. 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

Ethical Hacking Techniques: Cracking WPA/WPA2 Wi-Fi Using WPS and Capturing Handshakes

In the realm of cyber security, ethical hacking plays a crucial role in identifying and addressing vulnerabilities. One of the areas where e...