Dictionary comprehension issue for python 2.6

517 Views Asked by At

I have this line of code:

d = {t.tag: {k:v[0] if len(v) == 1 else v for k, v in dd.iteritems()}}

Unfortunately I'm working on python 2.6 and it does not support dictionary comprehensions.

How should it look to make it work for python 2.6?

0

There are 0 best solutions below