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.
^^ what johnny said
Think it should be log(n)
Description is purely maid, and i can't access list items by indexes
No, title can be an empty string. Print your inputs.
This comment is hidden because it contains spoiler information about the solution
One of your problems is that
replace
doesn't work as you think, you should read its documentation first.And you should use the markdown syntax to format your code and make it readable (three backticks
`
before and after your code will be a good start).Why does the if statement not break the loop and return s when it encounters first alphanumeric char?
for char in s[::-1]:
if char.isalpha():
return s
elif char == "!":
s = s.replace(char,"")
return s
This comment is hidden because it contains spoiler information about the solution
Didn't know we could specify another value when typecasting to int if the first one raises an error. Very cool trick!