Apr-19-2021, 05:18 PM
as mentioned by @ndc85430 it is unclear what are you actually trying to achieve
maybe something like this?
maybe something like this?
from itertools import chain spam = {'foo':1, 'bar':2} eggs = {'x':0, 'y':3} dicts = [spam, eggs] def get_keys(*args): for some_dict in args: print(list(some_dict.keys())) def get_keys2(*args): print(list(chain(*args))) get_keys(*dicts) get_keys2(*dicts)
Output:['foo', 'bar']
['x', 'y']
['foo', 'bar', 'x', 'y']
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs