python stack method for reverse string code
<p>I want to use the stack method to get reverse string in this revers question.<br>
"Write a function revstring(mystr) that uses a stack to reverse the characters in a string."<br>
This is my code.<br></p>

<pre><code>from pythonds.basic.stack import Stack
def revstring(mystr):

    myStack = Stack()   //this is how i have myStack

    for ch in mystr:   //looping through characters in my string
        myStack.push(ch)   //push the characters to form a stack

        revstr = ''  //form an empty reverse string
        while not myStack.isEmpty():

            revstr = revstr + myStack.pop()  //adding my characters to the empty reverse string in reverse order
            return revstr

print revstring("martin")
</code></pre>

<p><strong>the output seems to print out only the first letter of mystr that is "m"</strong>
why this??</p>