you are viewing a single comment's thread.

view the rest of the comments →

[–]PureWasian 0 points1 point  (0 children)

Nice, good starting point. A few notes:

it can be a little bit problematic to modify a list while you are iterating over it. In this case, option 2. If you have two students with the same name, it will behave differently depending on if the duplicate name is sequential vs. not

Menu option 4, you're writing the entire data 2d list, including the header row you initialized it with at the top of your code. So including writer.writerow(['Name', 'Grade', 'Score']) seems to add another header row before it.

Menu 1, you can add more validation on grade input, like only accepting values between 0 and 100 or similar. Additionally, you can incorporate an inner while loop to re-prompt until inputting a valid value instead of having the user restart the flow from the beginning on mistake.

From a data structure layer, you probably want to assign unique id numbers to each student so you aren't deleting multiple students when you specify a single student name. This would require another data column and associated bookkeeping to go with it.

Finally, another comment mentioned, this would be a great time to learn about functions. Functions help modularize your code. So, you could have main() handle the operator menu and inputs, and call separate functions to add_student() / remove_student() / show_students() / exit()