Use the str method to print the Boolean value as a string in Python.
Example print Boolean as a string
Simple python example code.
bool_val = True print(str(bool_val)) print(type(str(bool_val)))
Use + operator with str()
The advantage of converting a boolean into a string you can concatenating a boolean to a string that appends it to the end of another.
bool_val = True print("This is: " + str(bool_val))
This is: True
Do comment if you have any doubts and suggestions on this Python Boolean string topic.
Note: IDE: PyCharm 2021.1.3 (Community Edition)
All Python Examples are in Python 3, so Maybe its different from python 2 or upgraded versions.
Degree in Computer Science and Engineer: App Developer and has multiple Programming languages experience. Enthusiasm for technology & like learning technical.