Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- #
- # Aula.py
- #
- # Copyright 2021 Elizeu Barbosa Abreu <elizeubcorreios@gmail.com>
- #
- # This program is free software; you can redistribute it and/or modify
- # it under the terms of the GNU General Public License as published by
- # the Free Software Foundation; either version 2 of the License, or
- # (at your option) any later version.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License
- # along with this program; if not, write to the Free Software
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- # MA 02110-1301, USA.
- #
- #
- soma = 0
- c = 1
- count = 0
- nota = 1
- nome = str(input('Digite o seu nome: '))
- print(f'{nome}, você pode digitar zero "0" quando quiser sair:')
- while (nota != 0) or (nota == ' '):
- nota = float(input(f'{nome}, digite sua {c}ª nota: '))
- soma += nota
- c += 1
- if (nota != 0) or (str(nota) == ' '):
- count += 1
- media = soma/count
- if media >= 6:
- status = '\033[1;94mAPROVADO\033[m'
- else:
- status = '\033[1;91mREPROVADO\033[m'
- print(f'{nome}, você digitou {count} notas, totalizando {soma} pontos e média {media}.\nVocê está {status}...')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement