Please see the below image for reference:
Probably something like this:
d = {1:[2,3], 2:[4,5]} for key in d: for i in d[key]: print("{0}:{1}".format(key, i)) 1:2 1:3 2:4 2:5