First, if you want people to read your code you should use Codewars/Github markdown formatting, as it is much easier to read and copy paste - you can learn how to do this here:
Also, very important for troubleshooting - you can print the inputs so you can see which ones are failing: do this by adding print(word) in your Python code:
Hi and welcome to Codewars!
First, if you want people to read your code you should use Codewars/Github markdown formatting, as it is much easier to read and copy paste - you can learn how to do this here:
https://docs.codewars.com/references/markdown/
Also, very important for troubleshooting - you can print the inputs so you can see which ones are failing: do this by adding
print(word)
in your Python code:https://docs.codewars.com/training/troubleshooting/#error-messages-and-printing-your-inputoutput
Finally, for your solution - it is failing for tests involving
)
(
and other non-alphabetic chars in the inputs:"(( @"
" ( ( )"
so maybe you can slightly modify your code and things should work.
This comment is hidden because it contains spoiler information about the solution