from random import random x = 20 y = [] for i in range(x): y.append(random()) print(round(y[i],2), end=' ') print() minimum = 1 for i in y: if i < minimum: minimum = i print("The minimum element is: ", round(minimum, 2)) |
Output:
0.65 0.19 0.46 0.34 0.06 0.58 0.8 0.19 0.41 0.35 0.89 0.71 0.93 0.96 0.84 0.84 0.8 0.71 0.83 0.57
0.3 0.12 0.47 0.01 0.98 0.24 0.35 0.64 0.43 0.43 0.64 0.92 0.58 0.07 0.11 0.93 0.4 0.14 0.04 0.93 |