cnucup
0
Q:

true and false in python

# Booleans represent one of two values: True or False.
# When you compare two values, the expression is evaluated and Python returns the Boolean answer:
print(10 > 9)
> True
print(10 < 9)
> False
# All True Examples
bool("abc")
bool(123)
bool(["apple", "cherry", "banana"])
# All False Examples
bool(False)
bool(None)
bool(0)
bool("")
bool(())
bool([])
bool({})
5
>>> print(not False)
True
>>> print(not [])
True
>>> print(not None)
True
>>> print(not "")
True
>>> print(not '')
True
>>> print(not 0)
True
0
how to use true of false statements on python 
0
#Example I found:

my_boolean = 1
print(bool(my_boolean))

my_boolean = 0
print(bool(my_boolean))

my_boolean = 10
print(bool(my_boolean))

print("Coding" == "fun")
0
#Booleans are True or False values

t = True
f = False
1

New to Communities?

Join the community