I've been playing with Python and I have this list that I need worked out. Basically I type a list of games into the multidimensional array and then for each one, it will make 3 variables based on that first entry.
Array that is made:
Applist = [
['Apple', 'red', 'circle'],
['Banana', 'yellow', 'abnormal'],
['Pear', 'green', 'abnormal']
]
For loop to assign each fruit a name, colour and shape.
for i in Applist:
i[0] + "_n" = i[0]
i[0] + "_c" = i[1]
i[0] + "_s" = i[2]
When doing this though, I get a cannot assign to operator message. How do I combat this?
The expected result would be:
Apple_n == "Apple"
Apple_c == "red"
Apple_s == "circle"
Etc for each fruit.