Iterate through list, print iterable if the condition is met
<p>I have a list, containing random items, some of them consists of both numbers and letters.</p>

<pre><code>my_list = ["a a1", "b 2b", "c c", "d d"]
</code></pre>

<p>I need to print items that are only consisting of letters.
I tried </p>

<pre><code>for i in my_list:
    for j in i.split():
        if j.isalpha():
            print j
</code></pre>

<p>but it returns only</p>

<pre><code>c c
d d 
</code></pre>

<p>I also tried </p>

<pre><code>for i in my_list: 
    if any(n.isalpha() for n in i.split()):
        print n
</code></pre>

<p>but it returns </p>

<pre><code>NameError: name 'i' is not defined
</code></pre>

<p>I also need to print the initial contents of my_list, subtracting numbers from letters So it should look like this</p>

<pre><code>a a
b b
c c
d d
</code></pre>

<p>I tried this:</p>

<pre><code>for i in my_list:
    if all(n.isalpha() for n in i.split()):
        print i.title()
    elif any(n.isalpha() == False for n in i.split()):
        print n
</code></pre>

<p>but the abovementioned error occurs</p>

<pre><code>NameError: name 'n' is not defined
</code></pre>

<p>So in the example with "a a1", I need to find the part of the string which does not contains numbers and print it and find the part which contains a number, subtract it and print. I got stuck with this.    </p>