i have the following lists in python which i want to recombine into a dictionary/list:
names = ['banana','grapefruit','apple']
colors = ['yellow','pink','green']
to
fruits = [
{'name':'banana','color':'yellow'},
{'name':'grapefruit','color':'pink'},
{'name':'apple','color':'green'}
]
what’s the best way to do it? i’m currently tying my brain up in knots trying to write loops.
please help! 🙂
1 Answer