Review Note
Last Update: 07/10/2024 01:20 PM
Current Deck: Python fundamentals
PublishedCurrently Published Content
Code
x = [0, 0, 1, 0, 1] if any(x): print("yes") else: print("no") |
Output
yes
Explanation
any() flags whether any item in the given iterable is truthy.
Context
Current Tags:
Pending Suggestions
No pending suggestions for this note.