Added another example which returns False (#22794)

This commit is contained in:
Naida Agić
2018-11-19 09:36:27 +01:00
committed by Manish Giri
parent 1819e64cdd
commit 6ab303b1fc

View File

@ -50,6 +50,7 @@ There are three Boolean Operators they are `and`, `or`, and `not`.
print(bool(-4)) # Returns True as -4 is a non-zero value print(bool(-4)) # Returns True as -4 is a non-zero value
print(bool(0)) # Returns False as it is a zero value print(bool(0)) # Returns False as it is a zero value
print(bool('dskl')) # Returns True as the string is a non-zero value print(bool('dskl')) # Returns True as the string is a non-zero value
print(bool('')) # Returns False as the string is a zero value
print(bool([1, 2, 3])) # Returns True as the list is a non-zero value print(bool([1, 2, 3])) # Returns True as the list is a non-zero value
print(bool((2,3,4))) # Returns True as tuple is a non-zero value print(bool((2,3,4))) # Returns True as tuple is a non-zero value
print(bool([])) # Returns False as list is empty and equal to 0 according to truth value testing print(bool([])) # Returns False as list is empty and equal to 0 according to truth value testing