The Python Oracle

How do "and" and "or" act with non-boolean values?

This video explains
How do "and" and "or" act with non-boolean values?

--

Become part of the top 3% of the developers by applying to Toptal
https://topt.al/25cXVn

--

Track title: CC L Beethoven - Piano Sonata No 8 in C

--

Chapters
00:00 Question
00:56 Accepted answer (Score 185)
08:03 Answer 2 (Score 21)
09:27 Answer 3 (Score 8)
10:19 Answer 4 (Score 5)
11:11 Thank you

--

Full question
https://stackoverflow.com/questions/4700...

Accepted answer links:
[the docs]: https://docs.python.org/3/library/stdtyp...
[this post]: https://stackoverflow.com/a/39984051/490...

Answer 2 links:
[Python Docs]: https://docs.python.org/3/reference/expr...
[Patrick Haugh's answer]: https://stackoverflow.com/a/39984051/300...

Answer 4 links:
[short circuit evaluation]: https://en.wikipedia.org/wiki/Short-circ...
[mutable default argument pitfall]: http://docs.python-guide.org/en/latest/w...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #operators #logicaloperators