list index out of range in my coding
<p>Can anyone help me fix this error I keep getting please. I have tried to look for a solution but I can't find any. Below is the error message and also part of my coding</p>

<pre><code>Please enter your class Y or X or Z: Y
Traceback (most recent call last):
File "/Volumes/LIAM'S USB/DEV6 FINAL.py", line 118, in &lt;module&gt;
score=int(items[1])
IndexError: list index out of range


results={
start=True
while (start):
    pupil_class=input("\nPlease enter your class Y or X or Z: ")
    if pupil_class == ("Y"):
            classfile="Class_Y_results.txt" 
    elif pupil_class == ("X"):
            classfile="Class_X_results.txt" 
    elif pupil_class == ("Z"):
            classfile="Class_Z_results.txt" 

    f=open(classfile,'r')

    for line in f:
            items=line.split(',')       
            name=items[0]
            score=int(items[1])                
            if name in results:
                    results[name].append(score)                        
            else:
                    results[name]=[]
                    results[name].append(score)

    f.close()
</code></pre>