Hydration = {'Cola','Fanta','Coffee'}
Nutrition = {'Beef', 'Bacon','Beans'}
print ("Hydration Menu:")
print (Hydration)
print ("Nutrition Menu:")
print (Nutrition)
cost =[]
cost[Hydration] = 100
cost[Nutrition] = 60
That isn't all of my code, obviously. It's just the bits that matter regarding the problem.
It won't progress further because it can't recognise the cost[Hydration] = 100 bit.
It says:
line 36, in
cost[Hydration] = 100
TypeError: list indices must be integers, not set
I've tried a lot but my Python knowledge only goes so far, this code is for a vending machine simulation by the way.
Thanks for any help in advance. It's probably plainly obvious, I'm not very bright.