Kloe R.

asked • 05/16/18

Converting from a string to boolean in Python?

Does anyone know how to do convert from a string to a boolean in Python? I found this link. But it doesn't look like a proper way to do it. I.e. using a built in functionality, etc.
The reason I asked this is because I learned int("string"), from here. I tried bool("string") but always got True.

3 Answers By Expert Tutors

By:

Lane H. answered • 05/16/18

Tutor
5 (17)

Software Developer who loves to help others

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.