-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex084.py
More file actions
31 lines (26 loc) · 804 Bytes
/
Copy pathex084.py
File metadata and controls
31 lines (26 loc) · 804 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
25
26
27
28
29
30
#Faça um programa que leia nome e peso de várias pessoas,
# guardando tudo em uma lista. No final, mostre:
# A) Quantas pessoas foram cadastradas.
# B) Uma listagem com as pessoas mais pesadas.
# C) Uma listagem com as pessoas mais leves.
nome = list()
geral = list()
maisp = menosp = ''
while True:
nome.append(str(input('Nome: ')))
nome.append(float(input(('Peso (kg): '))))
geral.append(nome[:])
nome.clear()
resp = input('Deseja continuar?(s/n)')
if resp in 'Nn':
break
for c in range(len(geral)):
if c == 0:
menosp = geral[c][0]
if geral[c][0] > maisp:
maisp = geral[c][0]
else:
menosp = geral[c][0]
print(f'foram cadastrados {len(geral)} pessoas')
print(f'O menor pesso foi: {menosp}')
print(f'O maior peso foi : {maisp}')