7. Reverse


#1



Am I wrong??
This is my first time to post a question. I am from China :slight_smile:


def reverse(text):
    word=[]
    final=''
    for i in text:
        word.append(i)
        print word
    #return word
#print word
    for c in range(len(word)):
        final=final+word[-c-1]
    print final


It works perfect when I 'm run it in PyCharm


#2

You just need to use "return" instead of "print final"


#3

Yes, I see!
THX!!!! Happy 2017~


#4

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