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.
please do not post solutions in the discourse, otherwise anyone can see it without the spoiler flag. I have added the flag to your comment.
This comment is hidden because it contains spoiler information about the solution
What if needle does not exist in haystack ?!
saving a line break, does it really make the code faster? xD
Wow, didn't know you could define a function with an output in one line.
Probably the best solution
This comment is hidden because it contains spoiler information about the solution
The one example you showed using f string doesn't seems to work for me.
Update : sorry I should have put double quotation "needle" instead of 'needle'
I do the exact same thing then see someone being cleverer as always. I learn so much from this website! Also lambda would be even shorter
Actually it was the same for me but looking at other peoples solutions actually improved my future solutions... this website is one of the most helpful things ive used
its the pythonic way to do it
its sometimes more readable
Says the guy who did it in one line
Because it looks like we are pros I think =))
Why do people always so depserately try to do it in 1 line?
I assume it has something to do with it being simpler, however realisticly I think it makes it harder to read, not sure, probably also something to do with the single line looking more efficient at a glance, despite being the same output in the same amount of code as lower ones. Just a guess though.
Loading more items...