Hello,

I'm a newby to Python and I want to write a function which imports a CSV file and
returns a dictionary for the index of each subcategory in a column like this:
hockey: 3, Tennis: 54, volleyball: 59.

Any advise on how to adjust my code?
Thanks!

import csv

with open('pythonfile.csv', newline='') as csvfile:
test = csv.reader(csvfile, delimiter=' ', quotechar='|')
for row in pythonfile:
    print(', '.join(row))
fateurg123 commented: Info penting nih guys!! game MU legend kalo lu mau check graphicnya noh www.Econw.co udah launch guyss! gila gue gak sabar sih wwkwkwk +0

Can you please include the CSV format as a post attachment so we can understand the format of the file? Thanks!

commented: shape guess game python GUI tkinter +0
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.