dict((el,0) for el in a) will work well.
Python 2.7 and above also support dict comprehensions. That syntax is {el:0 for el in a}.
dict((el,0) for el in a) will work well.
Python 2.7 and above also support dict comprehensions. That syntax is {el:0 for el in a}.