TypeError without a clue


This Content is from Stack Overflow. Question asked by Nothingness

student_scores = input('Input a list of student scores: ')
for n in range(0, len(student_scores)):
    student_scores[n] = int(student_scores[n])

highest = 0
for scores in student_scores:
    if highest < scores:
        highest = scores
print(f'The highest score is {highest}')

I’m learning the basic of Python and input the code accurately that the tutorial video says, but only mine gets TypeError: ‘str’ object does not support item assignment on the line 3.
I checked it several times, but still have no clue why.


Check the Answers

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?