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.
Handy and readable.
Heck, wish I'd thought of that. Nice!
Fun 'one-liner' practice, but 'seq'/'elem' should be referred to rather than 'a/x' as in the instructions, or vice-versa. Having two referent terms for each is a bit confusing.
For simple statements like this, it's quite pythonic to put it on one line. Even for more complicated statements with ifs and for loops and generators, it is still often pythonic to put it on one line.
YMMV in other languages.
This is really quite novel. Nice!
It's not dissimilar to a 'for' loop with a list. Think of it as 'for [any item] in [what I'm telling you to look at]'.
In this case we're telling the program to look at a string, so the 'any item' is just 'any/each individual letter'. 'C' is simply a placeholder for that.
I appreciate this is checks watch 11 months late, but I hope it helps if you ever return here!
This comment is hidden because it contains spoiler information about the solution
Truly the HCIM of Codewars
I love this! Thanks for teaching me a new function. :)
Agreed - the comma's in a weird position here. Not a problem in the grand scheme of things, but not the neatest.
A prime example of how this website is a brilliant place to learn new functions. :)
Same! TIL
A quick word of thanks - I actively learned from this. I appreciate all of you who put this answer in and helped make my code better. :)
I don't know about industrial programming, but here it is often done like this
Q: How conventional is it to have this on one line over multiple? Apologies if this is a silly question - still learning. :)
Loading more items...