Review Note

Last Update: 07/10/2024 01:20 PM

Current Deck: Python fundamentals

Published

Currently Published Content


Code
x = [0, "", 0.0, False]

if any(x):
print("yes")
else:
print("no")


Output
no
Explanation
any() flags whether any item in the given iterable is truthy.
Context
Python

Current Tags:

python_fundamentals

Pending Suggestions


No pending suggestions for this note.