Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
wow
1K IQ play
I need this one explained to me lol Cause im not getting that at all
I need this one explained to me lol Cause im not getting that at all
genius
Lmao. I'm so stupid.
Nice!
You do not need to get to this level.
PEP 8 has a recommondation for only 79 characters per line.
Do not feel bad if you need multiple lines.
The multi liner with a propper For, add to list, return new list is not a bad solution either. Not even in terms of speed.
anytime you want? i mean, idk what exactly the code means/does but i solved it the same way lol
Its something like retrun ( output, loop ) if you wanna return multiple stuff, and python just knows your x without you having to introduce her to it
The more time I spend on this website, the more amaze I am of all these one liner that exist T-T
completely forget about list expressions man
Man, so simple... respect!
wow... so concise...
well.....
They don't.
The code you describe would return the first element of a list, while the solution above returns a list comprehension. In the later case, the whole list gets populated before the return statement executes.
Your described solution could come closer by using
yield
instead of return, except the return type would be a generator and not a list. Which means, for this to work you need a statement that would not interrupt the for-loop.Loading more items...