• New User having Issues

 

Hiya:

So, my code seems to be working for "Backward Each Word". I've tried it in mu and in the input window and it seems to work okay but when I use the 'check' butting it gives me an error. NB: I know my approach is that of an absolute novice...

Anyhoo, here is my code

def backwardstringby_word(text: str) -> str:

text = text +' '

ford = ''

back = ''

for i in text:
    if i.isalpha()==True:
        ford = ford + i
        back = i + back
    elif i.isalpha() !=True:
        text=text.replace(ford,back)
        ford = ''
        back = ''

return text.rstrip()