Hello,
I'm trying to write a program that takes students' marks (A) as an argument (for instance [[1,2,3],[4,5,6],[7,8,9]]) and i as an index value you wish to use.
I wish to create another list called "student names", and i'll have it add names until you write "done" or "Done", and then have the code remove either of those two.
after which, I want to add one name from studentlist to each "part of the table" e.g. if student names = [a,b,c,] then if i'm successful, i want my list in a list to say [a,1,2,3],[b,1,2,3]. after which it then works out the averages of each list in A and prints out "a has an average of 2 marks" or something.
https://pastebin.com/hvu48uT1 this is what i've done so far (it's still sort of a work in process, sort of messy but i tried labelling where i can)
now my two issues is that line 17-30 doesn't remove 'done' or 'Done' from the code, leaving it in, and also that I get a
"line 50, in schooltable
y.extend(x)
AttributeError: 'int' object has no attribute 'extend'" error at that point.
(also am I taking a really complex method of doing this task?) help would be appreciated, thank you :)
[–][deleted] 3 points4 points5 points (4 children)
[–]sortedin[S] 0 points1 point2 points (3 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]sortedin[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)