Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- c1,c2='\033[36m', '\033[33m'
- maior = homens = mulheres = 0
- while True:
- print(c1+ '{:=^60}'.format( ' CADASTRE UMA PESSOA '))
- idade = int(input(c1+'Idade: '+c2))
- sexo = []
- while sexo not in ('m', 'f'):
- sexo = str(input(c1+ 'Sexo: [M/F] ' +c2)).strip().lower()[0]
- if sexo != 'm' and sexo != 'f':
- print(c1+ '==============================' * 2)
- print(c2+ 'Opção incorreta tente outra vez!')
- print(c1+ '==============================' * 2)
- if idade >= 18: maior += 1
- if sexo == 'm': homens += 1
- if sexo == 'f' and idade < 20: mulheres += 1
- print(c1+ '==============================' * 2)
- resposta = []
- while resposta not in ('s', 'n'):
- resposta = str(input(c1+ 'Deseja continuar? [S/N]: ' +c2)).strip().lower()[0]
- if resposta == 'n':
- break
- print(c1+ '==============================' * 2)
- print(c2+ (f'Total de pessoas com mais de 18 anos: {maior}'))
- print(c2+ (f'Total de homens: {homens}'))
- print(c2+ (f'Total de mulheres com menos de 20 anos: {mulheres}'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement