by @codeexamples

How to convert a string to boolean in Python

Home » python » How to convert a string to boolean in Python

To convert a string to boolean, we can use double equals operator == in python.

Here is an example:

msg = "Hello"

convertB = (msg == "True")

print(convertB)

Output:

False