Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Python
  3. Question
Python

Converting from a string to boolean in Python?

Asked by Peter Wilkins Apr 2, 2021 1.2K views 1 answer
Share

About this question

Does anyone know how to do the conversion from a string to a boolean in Python?

The reason I asked this is because I learned int("string"), from here. I tried bool("string") but always got True.

>>> bool("False") 

True

Your answer

1 Answer

More Python discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Python Blogs

Guides, tips and career advice on Python from JanBask experts.