# 0208.py def f (x): return x*x a={x:f(x) for x in [0,1,3,4,7]} print (a) # {0: 0, 1: 1, 3: 9, 4: 16, 7: 49}