I am working on a program that takes a column from a csv file and averages the sales data, but I am getting an error: "unsupported operand type(s) for +: 'int' and 'str'"
I changed the column in the csv file to numbers and I still get the error.
from csv import reader opened_file = open('Catalog.csv') read_file = reader(opened_file) catalog_data = list(read_file) sales_data = [] for stuff in catalog_data: price = stuff[11] manufacturer = stuff[7] if manufacturer == 'HASBRO': sales_data.append(price) avg_sales = sum(sales_data) / len(sales_data)