This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
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 :)
Subreddit
Post Details
- Posted
- 6 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/learnpython...