You can use the dict constructor
d = dict(key1=val1, key2=val2)
or __setitem__ method
d = {}
d['key1'] = val1
d['key2'] = val2
There are other, even more flexible ways, but those are the basics.
solved Generate Dictionary in Python at run time [closed]