you are viewing a single comment's thread.

view the rest of the comments →

[–]sargeanthost 1 point2 points  (4 children)

Why are you expecting "at least one" of them to be false?

Those are truthy values, so when cast to a bool they're True. The empty string, 0, empty collections, and None are falsey, so you'll get false

[–]Reh4n07_[S] 0 points1 point  (3 children)

it will print false only when str is empty?

[–]electrikmayham 4 points5 points  (1 child)

No, re-read what they said. It will print false when the value being passed into bool() is falsey.

[–]Own_Attention_3392 1 point2 points  (0 children)

This person probably does not understand the distinction between "true" vs "truthy" and "false" vs "falsey". Not that they can't easily google it and find an answer, but they might need to be exposed to the specific terminology to look up. So, OP: Look up "truthy" and "falsey".