Reverse problem


Oops, try again. Your function fails on reverse("Python!"). It returns "!" when it should return "!nohtyP".

Code works fine in local spider File, and reverses text perfectly, but does not seem to work on here. Tips on mistakes i am making? Thanks :slight_smile:

Replace this line with your code. 

def reverse(text):
    for char in text:
    for item in reverselst:


In your loop you exit the whole function on each iteration, so there will only be one iteration, it's not a loop at all.


Thanks! i'll adjust :slight_smile:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.