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.
perfect
Please use spoiler flag next time.
This comment is hidden because it contains spoiler information about the solution
sorry
Please use spoiler flag next time.
This comment is hidden because it contains spoiler information about the solution
This solution was written in Python 2, where the division operator had a different behaviour.
how this solution was test-accepted? if there is an typeerror of non integer index
It is "+1" at the end because the slice operator (:) does not include the last position. So if you print(s[0:1]) it would only print the character at position 0.
for me too it says the slice index must be integer .....
but you can make it work by using the ineger division method(change the / to //)
this code does not work for me for some reason
its not a matter of big brain, just experience with a bit of love and openness to python. if you know python, you will become good at it. if you know python with computer science, you will become more confident at it. there are documentations written, good tutorials for ds and algo such as in geeksforgeeks, blogs, and books. pick your resources wisely and you will surely become better ! :D
in my opinion, there is a spectrum of being unpythonic and pythonic
this i believe is close to pythonic but because its short though not as efficient
Great! Thanks guys!
PS.: Forgot to mention I'm on Python 3.X
If we replace devision'/' to floor division '//', it will work as the floor division gets the integer quotient.
Loading more items...