Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python convert bool to string

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 #convert #bool #string
ADD COMMENT
Topic
Name
5+9 =