fork(3) download
  1. keys = ('python', 'proj')
  2. values = ['python', 'proj', 'proj']
  3.  
  4. d = {k: [] for k in keys}
  5. for v in values:
  6. d[v].append(v)
  7.  
  8. print(d)
Success #stdin #stdout 0.04s 9280KB
stdin
Standard input is empty
stdout
{'proj': ['proj', 'proj'], 'python': ['python']}