Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python print boolean

my_bool = True
str(my_bool) # Returns my_bool but as a string. (The word "True")

#-----How to print a bool------#
# Multi-line approach:
my_str = str(my_bool)
print(my_str) 

# One-line approach:
print(str(my_bool))
 
PREVIOUS NEXT
Tagged: #python #print #boolean
ADD COMMENT
Topic
Name
9+5 =