I'm learning python and working on exercises. One of them is to code a voting system to select the best player between 23 players of the match using lists.
I'm using Python3
.
My code:
players= [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
vote = 0
cont = 0
while(vote >= 0 and vote <23):
vote = input('Enter the name of the player you wish to vote for')
if (0 < vote <=24):
players[vote +1] += 1;cont +=1
else:
print('Invalid vote, try again')
I get
TypeError: '<=' not supported between instances of 'str' and 'int'
But I don't have any strings here, all variables are integers.