Split string > list of sublists of words and characters
<p>No imports allowed (it's a school assignment).</p>

<p>Wish to split a random string into a list of sublists. Words in a sublist, all other characters (including whitespace) would be in a sublist containing only one item. Anyone have some advice on how to do this;</p>

<pre><code>part = "Hi! Goodmorning, I'm fine."
list = [[H,i],[!],[_],[G,o,o,d,m,o,r,n,i,n,g],[,],[_],[I],['],[m],[_],[f,i,n,e],[.]]
</code></pre>

<p>Use this :</p>

<pre><code>list1 = []
part = "Hi! Goodmorning, I'm fine."
part = part.split()
num=part.count(" ")
for i in range(num+1):
    for item in part:
        list2 = []
        for i in item:
            list2.append(i)
        list1.append(list2)
        list1.append(['_'])
print list1
</code></pre>

python python-2.7