Practice Makes Perfect 7/15 Why do I get an error?


#1

My code does what it is supposed to do, but Im getting an error from Codecademy saying:

Did you create a function called reverse? Your code threw a “global name ‘reverse’ is not defined” error.

Any idea why?

My code:

def word(text):
letters = “”
for letter in range(len(text) - 1, -1, - 1):
x = letter
letters += text[x]
return letters
print word(“abcd”)


#2

you didn’t name your function reverse.


#3

Oh Jesus haha, thank you :smiley:


#4

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