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.
I missed the "All spaces in the string should be retained" part!
Other than that I got it! Wohoo!
when you use if nums
python check if the list at least have one element and return true
if list is empty python return false so automatically the if block is not excuted
nice
yessir
same as what did!
Well, I think that's wrong: the natural incstinct as a programmer is (or should be) to made the code clear and that includes variables that should be readable, consistent vs the code and logical so others (or our future ourselves) will know what the heck was a variable for. Obviously not in a short kata nor in some conditional/bucle sentences but in long programs, right?
This is a great solution for double and single spaces! But for anything more you'll need to utilize RegEx
Yeah, I would like to see that!!!
there's no problem? is there a problem? what is the problem?
and what's the problem if we only accept bool values?
just the zen of python ;)
but the point I was focusing is the build-in filter
Enveloping a function into a class for no particular reason sure makes a lot of sense ;)
none of you read the title!
where is that filter???
checkout my solution!
If you split for example "a__b" (double space instead of underscores) into a list, it will result in ["a", "", "b"].
When you join it later, there will be one space between "a" and the empty string "" - and another space between the empty string and "b". Therefore you end up keeping the double space like in the original string.
This comment is hidden because it contains spoiler information about the solution
Loading more items...