Python - Splitting List That Contains Strings and Integers
Question: 
    myList = [ 4,'a', 'b', 'c', 1 'd', 3]
    

how to split this list into two list that one contains strings and other
contains integers in _elegant/pythonic_ way?

output:

    
    
    myStrList = [ 'a', 'b', 'c', 'd' ]
    
    myIntList = [ 4, 1, 3 ]
    

NOTE: didn't implemented such a list, just thought about how to find an
elegant answer (is there any?) to such a problem.


Answer: As others have mentioned in the comments, you should really start thinking
about how you can get rid of the list which holds in-homogeneous data in the
first place. However, if that really _can't_ be done, I'd use a defaultdict:

    
    
    from collections import defaultdict
    d = defaultdict(list)
    for x in myList:
       d[type(x)].append(x)
    
    print d[int]
    print d[str]
    

