Logical 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.
>>> ##Logical operators=> (and, or):- Binary , Not:- unary
>>> 100<50
False
>>> 677>70
True
>>> 100<50 and 677>70
False
>>>
>>>
>>> 100>200
False
>>> 300<250
False
>>>
>>>
>>> 100>200 and 300<250
False
>>>
>>>
>>> 100>200 or 300<250
False
>>>
>>> 100>10 or 1000<100
True
>>>
>>> ## and needs both the conditions to be true to return true
>>> ##or needs either one condition to be true to return true
>>>
>>>
>>> 1000>100
True
>>>
>>> not 1000>100
False
>>>
>>>
>>> ## not:- true ,return false not:-false, return true.
Comments
Post a Comment