Let's say I have a list:
a = ['apple', 'carrot']
and a dictionary:
d ={'apple': [2,4], 'carrot': [44,33], 'orange': [345,667]}
How can I use the list a as a key to lookup in the dictionary d? I want the result to be written to a comma-separated textfile like this
apple, carrot
2, 44
4, 33
Corrected the a-list from a = ['apple', 'orange'] to a = ['apple', 'carrot']