-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexercise084.py
More file actions
36 lines (30 loc) · 764 Bytes
/
exercise084.py
File metadata and controls
36 lines (30 loc) · 764 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
31
32
33
34
35
36
temp = []
princ = []
mai = men = 0
while True:
temp.append(str(input('Name: ')))
temp.append(float(input('Weight: ')))
if len(princ) == 0:
mai = men = temp[1]
else:
if temp[1] > mai:
mai = temp[1]
if temp[1] < men:
men = temp[1]
princ.append(temp[:])
temp.clear()
resp = str(input('Continue? [Y/N] '))
if resp in 'Nn':
break
print('-=' * 30)
print(f'In all, you registered {len(princ)} people')
print(f'The biggest weight was {mai}kg. Name: ', end='')
for p in princ:
if p[1] == mai:
print(f'[{p[0]}] ', end='')
print()
print(f'The smallest weight was {men}kg. Name: ', end='')
for p in princ:
if p[1] == men:
print(f'[{p[0]}] ', end='')
print()