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.
ヽ(≧□≦)ノ
ヽ(≧□≦)ノ
Because for char in s, we are iterating over each character in the string s, and for each character c, we are multiplying it by 2 (c * 2) to create a new string with the character repeated twice. The join() method is then used to concatenate all the doubled characters into a single string.
i have no idiea ,absolute code
I think it is better to train yourself to be a oneliner. Actually I am new here. It is my second day here. And I am trying my best to complete challenges with one line only. It is fun you know. And it changes your mind a lot. THANK YOU ONE LINERS. You teach me a lot.
XD
You are pretty good))))
Well I call it Best Practices.
two years ago but we can assume the input will always be a bool since that is what it takes as an argument. Since its taking a boolean as an argument it is reasonable to assume it isn't accepting user input, rather the boolean is being generated elsewhere in the code.
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!
There are so many ways to use without regex. I did use /n next line add it in my expression
pro
same question, I squizzed out everything I have learned currently to solve it within 2 lines but these people are different level monsters.
Maybe you are pro, but I think mine is more human readable XD
This has to do with how CodeWars verifies solution. It (presumably) imports the module you wrote and then calls the function from that module. Instead of writing the function repeat_str yourself, you just import mul with the name repeat_str. When the verification program then calls repeat_str, it calls mul instead. Does that help?
Loading more items...