1

Are there any values other than False, None, 0, and 0.0 that will return False with bool(x) (in Python 3.X)?

2 Answers 2

7

See Truth Value Testing (docs.python.org)

Sign up to request clarification or add additional context in comments.

1 Comment

What I was looking for. >_> Thanks. I should probably refer to that resource more often.
3

Any empty sequence or mapping object will also evaluate to False:

>>> bool({})
False
>>> bool([])
False
>>> bool("")
False
>>> bool(())
False

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.