from pprint import pprint others = { } ignore = [] for i in others.keys(): ignore.append(i) pprint(ignore)