From user input, I can make a list. It is the intention for this list to be cross-checked with the dictionary and the corresponding value to be printed in another list.
Upon inputting "food" twice, a type-error of unhashable type: "list"
What can I do to solve this problem? Either through a change in ordering or the use of novel functions? This is my code:
grocery_market = {"food": 2}
shopping_list = []
max_shop_list = 2
while len(shopping_list) < max_shop_list:
item = input("Add an item: ")
shopping_list.append(item)
print(shopping_list)
print(grocery_market[shopping_list])