Learn Python like a Professional! Take You from 0 to Hero
In this Python lecture, we will learn about the Comparison Operators.
"Comparison operators are used to compare values. It either returns True or False according to the condition".
Comparison Operators in python
"Comparison operators are used to compare values. It either returns True or False according to the condition".
Comparison Operators in python
> Greater than - True if the left operand is greater than the right.
< Less than - True if the left operand is less than the right.
== Equal to - True if both operands are equal.
!= Not equal to - True if operands are not equal.
>= Greater than or equal to - True if the left operand is greater than or equal to the right.
<= Less than or equal to - True if the left operand is less than or equal to the right.
Let's see some example-
print( 2>1 )
print( 2>3 )
print( 2<1 )
print( 2<3 )
print( 1==1 )
print( 1==2 )
>> False
print( 1!=1 )
print( 1!=2 )
print( 2>=1 )
print( 2>=2 )
print( 2>=3 )
print( 2<=3 )
print( 2<=2 )
print( 2<=1 )
In the next Blog, we will discuss Chain Comparison Operator
https://sngurukuls247.blogspot.com/2018/09/python-ninja-bootcamp-15-chain.html
......................................................................................................................................
Instagram-
https://www.instagram.com/python.india/
View the Jupyter Notebook for this lecture
Download the Jupyter Notebook for this lecture
https://sngurukuls247.blogspot.com/2018/09/python-ninja-bootcamp-15-chain.html
......................................................................................................................................
Follow the link below to access Free Python Lectures-
https://www.youtube.com/channel/UCENc9qI7_r8KMf6-_1R1xnwInstagram-
https://www.instagram.com/python.india/
View the Jupyter Notebook for this lecture
Feel free contact me on-
Email - sn.gurukul24.7uk@gmail.com
No comments:
Post a Comment