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.
the .upper() function makes the string all capitals, so we are just comparing wether the all capitals version of the string is equal to the string, therefore checking if the string is all capitals
did the same, so neat!
Just a heads up, the default case is for those wild, unexpected situations, not when you're too lazy to add the last case.
Oh, indeed, input is string, not list :)
who can explain me this
just tested 'wqqq' case. indeed it fails.
love it
You are not first who noticed that) At the very bottom of commets you'll see almost the same statement from seven years ago. Nothing's changed since then:) Personally I did't test this solution.
No, It will fail in some cases like s = 'wqqq'.
But I think you're not seeing the forest for the trees here. The approach itself is incorrect (try inputs like
aaab
provided by other commenters); I think that's the main issue first and foremostpurest gold
That's very clever, congrats!
Clever, but not efficient. Nit: should space around operators by default to improve readability.
this is the best one
great
Loading more items...