Vote count:
0
i have made my code to a point where it writes the result in each cell in the excel file.
But however im having trouble with it , I want it to also write headings for example saying Name in B1 and then store the names entered in the code and also have a heading called Score in b1 and then the the outputed score below.
I have tried the same thing i done it my code for heading but wont work , any tips and help will be appreciated for a starting point.
if group == 'a':
with open ('classa.csv','a',newline='') as student:
foo = csv.writer(student,delimiter=',',)
bar = [[name, score]]
foo.writerows(bar)
elif group == 'b':
with open ('classb.csv','b',newline='') as student:
foo = csv.writer(student,delimiter=',',)
bar = [[name, score]]
foo.writerows(bar)
elif group == 'c':
with open ('classc.csv','c',newline='') as student:
foo = csv.writer(student,delimiter=',',)
bar = [[name, score]]
foo.writerows(bar)
asked 15 secs ago
Isit possible to add a heading to my code (involes writing in excel)
Aucun commentaire:
Enregistrer un commentaire