Ok, i know this topic has been addressed several times, but none of what i seen is helping me. I\'m getting the error in the title and i\'m not sure how to fix the error. He
You probably have at least one empty line in your file (usually the last line); explicitly test for that:
for record in students:
if not record.strip():
continue
n, ex1, ex2, ex3 = record.split(",")
You may want to look at the csv module to read your student records with instead; you'd still need to skip empty lines but the comma-splitting is handled for you.