擅长:python、mysql、java
<pre><code>In [32]: L = input("Enter a sentence: ").split()
Enter a sentence: Hello my name is
In [33]: L
Out[33]: ['Hello', 'my', 'name', 'is']
In [34]: L[0]
Out[34]: 'Hello'
In [35]: L[1]
Out[35]: 'my'
In [36]: for i in range(len(L)):
....: print(i, L[i])
....:
0 Hello
1 my
2 name
3 is
In [37]: firsts = [i[0] for i in L]
In [38]: firsts
Out[38]: ['H', 'm', 'n', 'i']
</code></pre>