Hi! I am having issues with the text file overwriting the last input from the first time it runs.
Let's say that I have three students with three different student IDs and grades. I need the input to be put into the text file and go down to a new line.
When I run this code, it just overwrites the old data with new data without creating a new line instead. May I have a few pointers on what I am doing wrong?
This is just a snippet of the code and if you need more, please let me know!
EDIT: I forgot to mention that this loop is also being looped depending or not if the user wants to run the for loop again. I would need to run it three times in this case.
Line 3: What's the purpose of the for loop? You're going to ask for quiz1-quiz4 5 times (ignoring the next problem), but studentID never changes.
Lines 8,12,16,20: Why are you adding i to itself? This is modifying your loop variable. Not a good idea.
Lines 22-23: You're going to be attempting to open "grading_list.txt" 5 times (assuming you fix the previous problem with i) and write the latest values to it.