from random import randint
n = int(input('Введите кол-во элементов: '))
arr = []
for _ in range(n):
arr.append(randint(10, 100))
print(arr)
MIN = None
for el in arr:
if el % 2 != 0:
if MIN:
if el < MIN:
MIN = el
else:
print(MIN)
Ответ:
j=[]
for i in range(90):
j.append(randint(10,100))
h=[]
for i in j:
if not i%2==0:
h.append(i)
print(min(h))
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
from random import randint
n = int(input('Введите кол-во элементов: '))
arr = []
for _ in range(n):
arr.append(randint(10, 100))
print(arr)
MIN = None
for el in arr:
if el % 2 != 0:
if MIN:
if el < MIN:
MIN = el
else:
MIN = el
print(MIN)
el - элемент массива
arr - массив(список)
Ответ:
from random import randint
j=[]
for i in range(90):
j.append(randint(10,100))
h=[]
for i in j:
if not i%2==0:
h.append(i)
print(min(h))