0

My program runs fine with the give parameters and outputs what is needed. Students.db also contains the right values. Even after reading a thread similar to this, I still don't know what I did wrong.

enter image description here

And my values I input: db.execute("INSERT INTO students (first, middle, last, house, birth) VALUES(?, ?, ?, ?, ?)", (my values) Even after trying with a value for the ID I just get

UNIQUE constraint failed: students.id

or the results present in check50 if the program appears to work.

  • You haven't altered the table in any way (other than deleting all data rows maybe)? The database name is still students.db, with lower-case S? You take the csv file from sys.argv[1]? – Blauelf Mar 3 '20 at 12:04
0

I had this problem. It seemed to have been caused by my code dropping and recreating the table every time it ran. I excluded those bits of code and had to delete the entire folder and redownload/unzip the houses zip file. I also had to rename characters.csv to students.csv because that's what the grader is looking for but it doesn't mention this in the problem set.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .