exercício
Pessoal, estou treinando aqui com Python e não estou entendo o porque deste erro.
Obrigado se alguém puder me ajudar.
numero_notas= int(input("Quantas notas irá calcular por aluno ?\n"))
x = 0
nota_media=0
while x < numero_notas:
notas_aluno[x] = float(input("Digite as notas do aluno\n"))
nota_media += notas_aluno[x]
x +=1
print("A média é " ,(nota_media / numero_notas))
-------------------------------------------------------------------------
C:\Python34\python.exe C:/Python/Estudos/escolanotas.py
Quantas notas irá calcular por aluno ?
5
Digite as notas do aluno
3
Traceback (most recent call last):
File "C:/Python/Estudos/escolanotas.py", line 7, in <module>
nota_media += notas_aluno[x]
TypeError: unsupported operand type(s) for +=: 'int' and 'str'
Process finished with exit code 1
Discussão (2)
Carregando comentários...