On 2012-10-23, at 10:45 PM, Demian Brecht <demianbre...@gmail.com> wrote:

>>>> list_ = [d[c] for c in s.strip('\n').split()]
>>>> list_
> ['1', '2', '1', '2', '2', '1']


Of course, if you want these to be ints, then you can either change the format 
of your int list, or map(int, list_) if you don't have control over it.

Demian Brecht
@demianbrecht
http://demianbrecht.github.com




-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to