Any advise on reverse?


#1

Yea its weird lol. Anyway, while we're here. Any advise on reverse??

MyCode =

"""
def reverse(text):
redo = ''
for char in range(len(text) -1, -1, -1):
redo += text[char]
return redo
print reverse(hello)

"""


Reverse retry
Is prime
#2

Pass the text in the form of a string, not a variable (hello is not defined).


#5

For practice, try re-posting your code so we can get a final look at it.


#6



def reverse(text):
    redo = ''
    for char in range(len(text) -1, -1, -1):
        redo += text[char]
    return redo
print reverse('hello')


#7

A post was split to a new topic: Returns just firs (or last symbole)


#8

This code runs fine. What are you finding?

olleh
nohtyP ytnoM

#10

It was the original indentation that was wrong but i fixed it while i was in the middle of learning how to properly transfer the code to the help section. I really appreciate your patience and assistance, seriously thank you.


#11

Forgot to mention that I had repaired that when we were DMing the topic. That's the code I tested, afterward.


#12

Well then, thank you again. I'm sure I'll be running into a different problem soon.