How Do You Replace Variables With Their Values?

CrazyVideoGamez jasonanyilian at gmail.com
Wed Jul 10 18:37:22 EDT 2019


How do you replace a variable with its value in python 3.7.2? For example, say I have:

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():
        meal = list(dinner[meal]

But I only get one list called "meal" and I'm just changing it with the code above (you can find that by printing it out). How can I make separate lists called 'Starters', 'Main Course', and 'Desert'? 



More information about the Python-list mailing list