Review Note

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

Current Deck: Python fundamentals

Published

Currently Published Content


Code
x = [1, 2, 3]

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

Output
yes
Explanation
all() flags whether all items in the given iterable are truthy.
Context

Current Tags:

python_fundamentals

Pending Suggestions


No pending suggestions for this note.