Sorry for the noobish question, but I'm trying to write a function that accepts strings as inputs. Here's what I've got:
def backwards(x):
word = "x"
index = 1
while index < len(word)+1:
letter = word[-index]
print letter
index = index + 1
Whenever I call the function, such as backwards(word), it gives me a name undefined error. How do I get it to accept the input?
Thanks for the help!