``````

In [1]:

x = True
y = False

``````
``````

In [2]:

print(x and y)

``````
``````

False

``````
``````

In [3]:

print(x or y)

``````
``````

True

``````
``````

In [4]:

print(not x)

``````
``````

False

``````
``````

In [5]:

print(bool(10))

``````
``````

True

``````
``````

In [6]:

print(bool(0))

``````
``````

False

``````
``````

In [7]:

print(bool(''))

``````
``````

False

``````
``````

In [8]:

print(bool('0'))

``````
``````

True

``````
``````

In [9]:

print(bool('False'))

``````
``````

True

``````
``````

In [10]:

print(bool([]))

``````
``````

False

``````
``````

In [11]:

print(bool([False]))

``````
``````

True

``````
``````

In [12]:

x = 10  # True
y = 0  # False

``````
``````

In [13]:

print(x and y)

``````
``````

0

``````
``````

In [14]:

print(x or y)

``````
``````

10

``````
``````

In [15]:

print(not x)

``````
``````

False

``````
``````

In [16]:

x = 10  # True
y = 100  # True

``````
``````

In [17]:

print(x and y)

``````
``````

100

``````
``````

In [18]:

print(y and x)

``````
``````

10

``````
``````

In [19]:

print(x or y)

``````
``````

10

``````
``````

In [20]:

print(y or x)

``````
``````

100

``````
``````

In [21]:

x = 0  # False
y = 0.0  # False

``````
``````

In [22]:

print(x and y)

``````
``````

0

``````
``````

In [23]:

print(y and x)

``````
``````

0.0

``````
``````

In [24]:

print(x or y)

``````
``````

0.0

``````
``````

In [25]:

print(y or x)

``````
``````

0

``````