Having a list like this:
[\'foo\',\'spam\',\'bar\']
is it possible, using list comprehension, to obtain this list as result?
[\
In [67]: alist = ['foo','spam', 'bar'] In [70]: [prefix+elt for elt in alist for prefix in ('','ok.') ] Out[70]: ['foo', 'ok.foo', 'spam', 'ok.spam', 'bar', 'ok.bar']