Python TypeError: 'int' object is not subscriptable -
this question has answer here:
i trying create ballot system in user can input candidates names , input preference scores. program works out winner , prints result.
i getting annoying return console when run line of code.
for in range(len(winners)[i]):
the error reads:
typeerror: 'int' object not subscriptable
(edited: code dump redacted.)
you want iterate on winners:
for in winners:
what trying do::
for in range(len(winners)):
will iterate through indexes, error [i]
have nothing here.
Comments
Post a Comment