-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathExercicio 69.py
More file actions
24 lines (24 loc) · 822 Bytes
/
Copy pathExercicio 69.py
File metadata and controls
24 lines (24 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#Programa que ler dados de pessoas e mostra no final
conti = ''
maior = menor = homens = 0
while True:
if conti in 'sS':
idade = int(input('Qual idade :'))
if idade > 18:
maior += 1
sexo = str(input('Qual sexo :')).strip().lower()[0]
if not sexo in 'fmFM':
while not sexo in 'fmFM':
sexo = str(input('Qual sexo :')).strip().lower()[0]
if sexo == 'm':
homens += 1
if sexo == 'f' and idade < 18:
menor += 1
conti = str(input('Quer continuar?'))
elif conti in 'nN':
break
else:
conti = str(input('Quer continuar?'))
print(f'Temos {maior} pessoas maiores de 18 anos')
print(f'Ao todo temos {homens} homens cadastrados')
print(f'Temos ao todo {menor} mulheres menores de idade')