0
I am a beginner in programming and am doing an exercise in which I need to count the votes of certain numbers according to the number of the player’s shirt. For example, if I type in the program 23, 3 times, the number 23 will have 3 votes. I wonder if there is any way to go adding the number of votes in the key value.
while numero_camisa != 0:
numero_camisa = int(input('Informe o número da camisa do jogador ou zero para sair: '))
if numero_camisa < 0 or numero_camisa > 23:
print('Número da camisa inválido, favor informar um número entre 1 e 23.')
votos_atletas[numero_camisa] = #acrescentar o número de votos conforme o número da camisa.
My code so far, was like this. Now is the doubt, there is a way to add the number of votes according to what the user is reporting ?
This exercise can be found at https://wiki.python.org.br/ExerciciosListas, exercise nº 18.
– Thiago Pereira