My code is correct but i was wondering how can I add raw input to that code so that a user could type a word normally and it will come out in reverse?
key = ""
index = len(text)
for i in range(0, index):
key = key + text[(index - 1) -i]
you can add a raw_input before your function:
user_input = raw_input("enter a string you want reversed")
and then pass user_input as argument in the function call:
2 posts were split to a new topic: Reverse
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.