On 7/11/2019 12:51 AM, Aldwin Pollefeyt wrote:
dinner = {'Starters':['Fried Calamari', 'Potted crab'],'Main
Course':['Fish', 'Meat'], 'Desert':['Cake', 'Banana Split']}

# Don't ask where I got the dinner from

for meal in dinner.keys():
     exec(meal.replace(' ','_') + ' = list(dinner[meal])')

If dinner came from an untrusted source, and the OP does not say differently, this would be a stupid thing to do.

--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to