-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEX - 56.py
More file actions
24 lines (23 loc) · 782 Bytes
/
EX - 56.py
File metadata and controls
24 lines (23 loc) · 782 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
somaidade = 0
md = 0
maioridade = 0
nomevelho = ''
totmulher20 = 0
for c in range(1, 5):
print('-----{}ª PESSOA ----'.format(c))
nome = str(input('informe seu nome: ')).strip()
idade = int(input('Informe sua idade: '))
sexo = str(input('Sexo [M/F]')).strip()
somaidade += idade
if c == 1 and sexo in 'Mm':
maioridade = idade
nomevelho = nome
if sexo in 'Mm' and idade > maioridade:
maioridade = idade
nomevelho = nome
if sexo in 'Ff' and idade < 20:
totmulher20 += 1
md = somaidade / 4
print('A média de idade do grupo é de {} anos'.format(md))
print('O homen mais velho tem {} anos e se chama {}'.format(maioridade, nomevelho))
print('Ao total são {} mulheres com menos de 20 anos.'.format(totmulher20))