Is there a pythonic way to use items in a list to define a dictionary's key and values?
For example, I can do it with:
s = {}
a = ['aa', 'bb', 'cc']
for a in aa:
s['text_%s' %a] = 'stuff %s' %a
In [27]: s
Out[27]: {'text_aa': 'stuff aa', 'text_bb': 'stuff bb', 'text_cc': 'stuff cc'}
I wanted to know if its possible to iterate over the list with list comprehension or some other trick.
something like:
s[('text_' + a)] = ('stuff_' + a) for a in aa
thanks!