Loop to print name, removing one character at a time
<p>I'm having a little trouble creating a program which prints out the name of the user downwards that always removes the first character each row then when it's at the last letter go up again.</p>

<p>This is what i have so far: </p>

<pre><code>name = input("Put in a name: ")
name_length = len(name)

for counter in range(name_length,0, -1):    
    print(counter)
</code></pre>

<p>Below Is what it is supposed to end like</p>

<p><a href="http://i.stack.imgur.com/5rPWa.png" rel="nofollow"><img src="http://i.stack.imgur.com/5rPWa.png" alt="enter image description here"></a></p>

<p>Recursive answer</p>

<p>Essentially, print the same string twice, but in-between call the function again, but with the first character removed. When the start index is greater than the length of the string - 1, then you have one character left. </p>

<pre><code>def printer(str, start=0):
    s = str[start:]
    if len(str) - 1 &lt;= start:
        print s
        return
    print s
    printer(str, start + 1)
    print s
</code></pre>

<p>Output </p>

<pre><code>Put in a name: cricket_007
cricket_007
ricket_007
icket_007
cket_007
ket_007
et_007
t_007
_007
007
07
7
07
007
_007
t_007
et_007
ket_007
cket_007
icket_007
ricket_007
cricket_007
</code></pre>

python for-loop