Created
September 5, 2021 22:15
-
-
Save MoranggNormal/77d3ee847389034439d647bfa1d28913 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def aluno_nome(): | |
return input('Digite seu nome: ') | |
def aluno_nota(): | |
return input('Digite sua nota: ') | |
def mensagem(nome, nota, conceito): | |
return print('O aluno(a) {} obteve a nota final de {} e se encaixa no conceito {}'.format(nome, nota, conceito)) | |
def mostrar_resultado(): | |
nome = aluno_nome() | |
nota = float(aluno_nota()) | |
print(nota) | |
if 0 < nota < 2.9: | |
mensagem(nome, nota, 'E') | |
elif 3 < nota < 4.9: | |
mensagem(nome, nota, 'D') | |
elif 5.0 < nota < 6.9: | |
mensagem(nome, nota, 'C') | |
elif 7.0 < nota < 8.9: | |
mensagem(nome, nota, 'B') | |
elif 9.0 < nota < 10: | |
mensagem(nome, nota, 'A') | |
else: | |
print('Nota inválida.') | |
def iniciar_programa(): | |
while True: | |
confirmar = input('Deseja iniciar o programa? digite sim ou nao') | |
if confirmar == 'sim': | |
mostrar_resultado() | |
elif confirmar == 'nao': | |
print('Saindo do programa...') | |
break | |
else: | |
print('Resposta inválida.') | |
break | |
iniciar_programa() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment