-
Notifications
You must be signed in to change notification settings - Fork 0
/
exercise078.py
29 lines (24 loc) · 716 Bytes
/
exercise078.py
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
listnum = []
higher = 0
smaller = 0
for c in range(0, 5):
listnum.append(int(input(f'Enter a number for position {c}: ')))
if c == 0:
higher = smaller = listnum[c]
else:
if listnum[c] > higher:
higher = listnum[c]
if listnum[c] < smaller:
smaller = listnum[c]
print('=-' * 30)
print(f'You entered the values {listnum}')
print(f'The highest value entered was {higher} in positions ', end='')
for i, v in enumerate(listnum):
if v == higher:
print(f'{i}... ', end='')
print()
print(f'The lowest value entered was {smaller} in positions ', end='')
for i, v in enumerate(listnum):
if v == smaller:
print(f'{i}... ', end='')
print()