comparison operators
Python 3.9.1 (tags/v3.9.1:1e5d33e, Dec 7 2020, 17:08:21) [MSC v.1927 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> ##comparison operators => returning True or False
>>> ##<,>,==,<=,>=,!=
>>> 87474<8787
False
>>> 748647>874857945
False
>>> 7847586486>767456
True
>>> g=500
>>> h=600
>>> g<H
Traceback (most recent call last):
File "<pyshell#7>", line 1, in <module>
g<H
NameError: name 'H' is not defined
>>> g<=h
True
>>> g>=h
False
>>> g!=h
True
>>> p=1000
>>> g==h
False
>>> h==p
False
>>> v=1000
>>> v==p
True
>>> t=1000.0
>>> t==p
True
>>>
Comments
Post a Comment