Code fails on CodeAcademy, works on personal machine


#1



This message keeps popping up when I run my code:

Oops, try again. Your function fails on reverse("Python!"). It returns "['!', 'n', 'o', 'h', 't', 'y', 'P', 'c', 'b', 'a']" when it should return "!nohtyP".

When running via the terminal in my computer it works fine, and prints out "!nohtyp".

text_list = []
def reverse(text):
    for i in text:
        text_list.insert(0, i)
    return text_list


#2

the exercise only calls the function for validation, so place text_list = [] inside the function

this i need to see, can you upload a screenshot of the code + output?


#4

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