Here is a dictionary:
my_dict = {'id': '5f7756f5141a30516ba0fe1d',
'name': 'Flask',
'desc': '',
'descData': None,
'closed': False,
'idOrganization': None,
'idEnterprise': None,
'pinned': False,}
What I need:
A good code sample that uses a loop/filter/map (whatever it takes) to get this filtered result:
{'name': 'Flask', 'idOrganization': None}
My Problem:
I assumed I would loop through the keys with dummy code something like:
for the_key in my_dict:
if the_key == 'name' or 'idOrginization':
print (the key with its value)
I can get keys back from if statement, but I need the values along with it as well.