Python Indexing not returning expected value
<p>I am trying to return the value M from Mr. Smith but whenever I run my code below it returns ''</p>

<pre><code>&gt;&gt;&gt;name = input("Please input your name: ")
Please input your name: Mr. Smith 
&gt;&gt;&gt; if name == name.find(' ') and name.isalpha():
    get_initial = name[0]
&gt;&gt;&gt;get_initial
''
</code></pre>

<p>python 3 </p>

<pre><code>   name = input("Please input your name: ")
    c=name.strip()[0]
    if c.isalpha():
        print(c)
</code></pre>

<p>python 2 :</p>

<pre><code>&gt;&gt;&gt; name = raw_input("Please input your name: ")
Please input your name:   Hisham
&gt;&gt;&gt; c=name.strip()[0]
&gt;&gt;&gt; if c.isalpha():
    print c
</code></pre>

<p>output py3:</p>

<pre><code>Python 3.5.2 (default, Dec 2015, 13:05:11)
[GCC 4.8.2] on linux

Please input your name:   dsfgsdf
d
</code></pre>

<p>output py2:</p>

<pre><code>H
</code></pre>

python