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>I think it will work:</p>

<pre><code>name = input("Put in a name: ")
for i in range(len(name)):          # for 1st half
    print(name[i:])
for i in range(len(name)-2,-1,-1):  # for 2nd half
    print(name[i:])
</code></pre>

<p><strong>Input:</strong></p>

<pre><code>stack
</code></pre>

<p><strong>Output:</strong></p>

<pre><code>stack
tack
ack
ck
k
ck
ack
tack
stack
</code></pre>

<p>I Split output into two halfs:</p>

<p>1st half:</p>

<pre><code>stack
tack
ack
ck
k
</code></pre>

<p>Which will be achieved by 1st <code>for</code> loop using Slice (check to understand more <a href="http://stackoverflow.com/questions/509211/explain-pythons-slice-notation">Explain Python&#39;s slice notation</a>)</p>

<p>And 2nd half:</p>

<pre><code>ck
ack
tack
stack
</code></pre>

<p><strong>Note:</strong> You can print single character in this example <code>k</code> in 1st <code>for</code> loop like i do  or in 2nd <code>for</code> loop, it up to you.</p>

<p>Hope this helps.</p>

<p>Although I think you should use solution suggested by @Andrew it's pretty cool if you <code>print a</code> in his solution you get the sequence <code>[0, 1, 2, 3, 4, 3, 2, 1, 0]</code> for slice the string so can be done in single <code>for</code> loop</p>

python for-loop