from random import randint
a = [randint(1, 10) for _ in range(10)]
_min = a[0]
print(f"Массив: {a}")
for i in range(1, len(a)):
if _min > a[i]:
_min = a[i]
print(f"Минимальный элемент массива {_min}")
Программа:
arr = [randint(1, 10) for i in range(10)]
print(min(arr))
Или:
print(min([randint(1, 10) for i in range(10)]))
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
from random import randint
a = [randint(1, 10) for _ in range(10)]
_min = a[0]
print(f"Массив: {a}")
for i in range(1, len(a)):
if _min > a[i]:
_min = a[i]
print(f"Минимальный элемент массива {_min}")
Программа:
from random import randint
arr = [randint(1, 10) for i in range(10)]
print(min(arr))
Или:
from random import randint
print(min([randint(1, 10) for i in range(10)]))