Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python3 conditional with boolean

a = True  # case sensitive, so use True or False
# or
x = 0
a = bool(x)  # this is False, any other number is True
# or
x = 'Non-empty string'
a = bool(x) # this is True 

if a == True:
     print("a is true")
 
PREVIOUS NEXT
Tagged: #conditional #boolean
ADD COMMENT
Topic
Name
7+3 =