Using the following table, I want to create a dictionary with fruits as the keys and the quantity as values
grades = [['Fruit', 'Apples', 'Bananas', 'Coconut'],
['Jim', '4', '5', '6'],
['Kevin', '7', '8', '10'],
['Clayton', '8', '9', '2']]
For Example :
QuantityList['Apples'] == [4,7,8]
I have the following code below but i get a "'list' object is not callable" error.
num=[y[1:] for y in table[1:]]
fruits = table[0][1:]
QuantityList={y[0]: {int(i) for i in num()} for y in fruits}
print(QuantityList)
Can someone provide some direction on how to fix this?
grades?