In Python, builtin functions any() and all() are a great way to validate a list containing arbitrary data. Similar to Array.every() and Array.some() in JavaScript.

Throw away your for-loops and embrace these next time.

@nikoheikkila I love these — .NET does them really well by allowing them on any iterable — but the weird names JS uses for them drive me entirely up the wall.

Sign in to participate in the conversation
Mastodon for Tech Folks

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!