(False or False or False or True or False or False) = True - Why is Python so bloody optimistic? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

(False or False or False or True or False or False) = True - Why is Python so bloody optimistic?

Don't believe me? - then run this code > https://code.sololearn.com/cqoD5tWsk50m/#py How could this ever be useful? Has anyone got an example? P.S. - Yes, in school, most of my teachers didn't like me very much.

21st Apr 2017, 3:38 PM
Lium Goon
Lium Goon - avatar
3 Answers
+ 4
It can be useful if you try to find if there is at least one occurence of a value in a set. Of course you then use "if a IN b" syntax but it essentially is a multiple OR check-up.
21st Apr 2017, 4:06 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 2
You should learn to evaluate boolean expressions. https://code.sololearn.com/c48CtJEIe9LJ/?ref=app
21st Apr 2017, 3:30 PM
Tob
Tob - avatar
+ 1
@ Tobi ... and, in my example - how could that ever be useful?
21st Apr 2017, 3:37 PM
Lium Goon
Lium Goon - avatar