I’m currently going through exam statistics exercises in python, and I’ have a following issue:
While trying to loop over a list, using expression:
for i in scores: total+= scores[i]
returns a index out of range error, while
for i in range(len(scores)): total+= scores[i]
works just fine.
Could somebody explain to me why is that? I thought that both expressions should work the same.