I need to convert a csv file into a dictionary.The input file is 4 columns and about food from Chick Fila.
I want the dictionary to return something like this:
{ “Spicy Chicken Sandwich” : (3.99, 460, 'Entrees'), “Grilled Chicken Sandwich” : (5.15, 320, 'Entrees'), “Market Salad” : (8.19, 250, 'Salads') }.
it is the item, price, calories, and type
I have tried so many times to figure it out. I am in an intro to python class. So far I have this code:
def read_file(filename):
with open("menu1.csv") as f:
for line in f:
Any help would be amazing!