Re: How Do You Replace Variables With Their Values?

2019-07-14 Thread Chris Angelico
On Mon, Jul 15, 2019 at 5:45 AM Ian Kelly wrote: > > On Thu, Jul 11, 2019 at 11:10 PM Chris Angelico wrote: > > > > On Fri, Jul 12, 2019 at 2:30 PM Aldwin Pollefeyt > > wrote: > > > > > > Wow, I'm so sorry I answered on the question : "How do you replace a > > > variable with its value". For

Re: How Do You Replace Variables With Their Values?

2019-07-14 Thread Ian Kelly
On Thu, Jul 11, 2019 at 11:10 PM Chris Angelico wrote: > > On Fri, Jul 12, 2019 at 2:30 PM Aldwin Pollefeyt > wrote: > > > > Wow, I'm so sorry I answered on the question : "How do you replace a > > variable with its value". For what i understood with the example values, > > CrazyVideoGamez wants

Re: How Do You Replace Variables With Their Values?

2019-07-11 Thread Chris Angelico
On Fri, Jul 12, 2019 at 2:30 PM Aldwin Pollefeyt wrote: > > Wow, I'm so sorry I answered on the question : "How do you replace a > variable with its value". For what i understood with the example values, > CrazyVideoGamez wants 3 variables named like the meal-names in dictionary. > Yes, it's not

Re: How Do You Replace Variables With Their Values?

2019-07-11 Thread Aldwin Pollefeyt
Wow, I'm so sorry I answered on the question : "How do you replace a variable with its value". For what i understood with the example values, CrazyVideoGamez wants 3 variables named like the meal-names in dictionary. Yes, it's not secure unless you work with your own dataset (just like sending

Re: How Do You Replace Variables With Their Values?

2019-07-11 Thread Ben Finney
Aldwin Pollefeyt writes: > 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])') > >

Re: How Do You Replace Variables With Their Values?

2019-07-11 Thread Chris Angelico
On Fri, Jul 12, 2019 at 4:37 AM Terry Reedy wrote: > > 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

Re: How Do You Replace Variables With Their Values?

2019-07-11 Thread Rhodri James
On 11/07/2019 05:51, 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])')

Re: How Do You Replace Variables With Their Values?

2019-07-11 Thread Terry Reedy
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])')

Re: How Do You Replace Variables With Their Values?

2019-07-11 Thread Aldwin Pollefeyt
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])') print(Starters) print(Main_Course) print(Desert)

Re: How Do You Replace Variables With Their Values?

2019-07-10 Thread Frank Millman
On 2019-07-11 12:43 AM, CrazyVideoGamez wrote: 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

Re: How Do You Replace Variables With Their Values?

2019-07-10 Thread Ben Finney
Terry Reedy writes: > On 7/10/2019 6:37 PM, CrazyVideoGamez wrote: > > > 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'? > > starters = dinner['Starters'] > main_course =

Re: How Do You Replace Variables With Their Values?

2019-07-10 Thread Terry Reedy
On 7/10/2019 6:37 PM, CrazyVideoGamez wrote: the below twice. Please post just once and be patient for at least a couple of hours -- or days if not subscribed. How do you replace a variable with its value in python 3.7.2? Use the variable (name) in an expression. But this is not what you

How Do You Replace Variables With Their Values?

2019-07-10 Thread CrazyVideoGamez
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 =

How Do You Replace Variables With Their Values?

2019-07-10 Thread CrazyVideoGamez
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 =