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.
You can search for 'Inline IF statement' or list comprehension. Basically when creating a variable you can put in that same line an IF logic to see what you will assign. For example "Size = 'small' if x < 10 else 'large'" Here depending on x the variable will be 'small' or 'large' in one line instead of having 4 lines.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Please go ahead and translate. The description may need to be updated. E.g., Scala could use a stream.
How attached are you to any Python-specificity of this, or would you be fine with us translating to other languages (specifically Scala and JS)?
Read up on generators here.
Hey I have a question, forgive me if this sounds silly I'm very much a beginner to this. But if I generate the full closure of S, won't the code just keep running forever because it's an infinite set? Or is there something specific I'm supposed to do that I'm just not understanding yet?
I think I just lost the ability to read. Permanently.
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!
How did I not know that you can multiply strings!? What on earth?
My brain isn't working... what even?