-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex69.py
More file actions
36 lines (36 loc) · 1.22 KB
/
Copy pathex69.py
File metadata and controls
36 lines (36 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
maioridade = homens = mulheres = 0
while True:
print(f"\033[36m{'CADASTRE UMA PESSOA':=^40}\033[m")
idade = int(input('Idade: '))
sexo = ' '
while sexo not in 'MF':
sexo = str(input('Sexo [M/F]: ')).strip().upper()[0]
escolha = ' '
while escolha not in 'SN':
escolha = str(input('Quer continuar? [S/N]: ')).strip().upper()[0]
if idade >= 18:
maioridade += 1
if sexo == 'M':
homens += 1
if sexo == 'F' and idade < 20:
mulheres += 1
if escolha == 'N':
break
if maioridade == 1:
print('Existe uma pessoa maior de idade cadastrada')
if maioridade >= 2:
print(f'Existem {maioridade} pessoas maiores de 18 cadastradas')
if maioridade == 0:
print('Não existe pessoas maiores de idade cadastradas')
if homens == 1:
print('Existe apenas um homem cadastrado')
if homens >= 2:
print(f'Existem {homens} homens cadastrados.')
if homens == 0:
print('Não há homens cadastrados')
if mulheres == 1:
print('Existe apenas uma mulher com menos de 20 anos cadastrada')
if mulheres >= 2:
print(f'Existem {mulheres} mulheres com menos de 20 anos cadastradas')
if mulheres == 0:
print('Não há nenhuma mulher com menos de 20 anos cadastrada')