4 ms·
when I saw the first() function, I thought it was some default python that was new to me. But he defines it above in his commonly used functions: def firs
by philshem 6y ago
when I saw the first() function, I thought it was some default python that was new to me.
But he defines it above in his commonly used functions:
def first(iterable, default=None) -> object:
"Return first item in iterable, or default."
return next(iter(iterable), default)