Tuesday, 19 July 2016

Logical Operators in Python

Logical operators in Python are represented by three keywords which are as given below

AND
OR
NOT
And:this will check the two conditions which is given in right side and left side. If both conditions are become true then result would be true otherwise this will return as false.
Let’s suppose you have two variables a and b. a contain the value as 20 and b contain the value as 30 in Python
Find the below examples for the same
(a>   b) and (a! =b)
>>Output would be false
Because this will check both of the conditions if both conditions are true then only result would be true.
Or:   This will also check the two conditions which is given in right side or left side. If one of the conditions is true, then result would be true.
(a<b) or (a>b)
>> Output would be true
(a>b) or (a==b)
>> Output would be False

Softcrayons tech Solutions is a best Python training institute in Ghaziabad. We provide free demo class for python Course.

No comments:

Post a Comment