From random import random
N = 10
a = []
for i in range(N):
b = int(random() * 50)
a.append(b)
print(a)
min = a[0]
max = a[0]
for i in range(N):
if (a[i] < min):
min = a[i] if a[i]>max:
max = a[i]print('min = ',min)
print('max = ',max)
Пример:
[48, 12, 44, 48, 32, 1, 10, 37, 42, 21]
min = 1
max = 48