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.
SyntaxError: assignment expression cannot be used in a comprehension iterable expression
Yeah but... This is just a simple one-liner. So it's still pretty readable, for me at least
It's not THAT bad at the end of the day 😅
You can avoid this now with the walrus operator
This comment is hidden because it contains spoiler information about the solution
I did it this way and was so proud of myself for figuring out the list comprehension XD
This is like what I did, but in one line.
Thank you for this! This is what I wanted to do but didn't know how to do, so had to longhand it. This is very neat, thanks for teaching me
This comment is hidden because it contains spoiler information about the solution
OMG, thank you so much for this. I kept seeing this syntax in katas and had no idea what was going on. Appreciate it so much!
did the same hehe
You modified the name of the given parameter, which I wouldn't consider 1) useful and 2) good practice, especially since
str
shares its name with a function.This comment is hidden because it contains spoiler information about the solution
Python noob here, I gotta say Python one-liners like list comprehension are starting to look pretty understandable (at this level of complexity, at least...)
But cramming logic that repeats on each 'x' doesn't look good for Big O, for sure.
我靠
Loading more items...