Skip to content

Instantly share code, notes, and snippets.

@fernandosavio
Created June 5, 2017 17:41
Show Gist options
  • Save fernandosavio/e8247852fd7a2ecde1c9d29e997e13cd to your computer and use it in GitHub Desktop.
Save fernandosavio/e8247852fd7a2ecde1c9d29e997e13cd to your computer and use it in GitHub Desktop.
notas = []
# registra todas as 10 notas
for i in range(1, 11):
nota = float(input("Insira a nota do {}º aluno: ".format(i)))
notas.append(nota)
# calcula a média
media = sum(notas)/len(notas)
print('Média:', media)
# https://docs.python.org/3.6/library/functions.html#zip
for aluno, nota in zip(range(1, 11), notas):
if nota > media:
print("O aluno {} com a nota {} está acima da média.".format(aluno, nota))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment