from random import randint
n = 6
mass = [randint(0, 20) for i in range(n)]
m = 10
p = 30
k = 0
for i in range(n):
if mass[i] > m:
mass[i] = p
k += 1
print(mass, k)
Объяснение:
from random import randint
n = 6
mass = [randint(0, 20) for i in range(n)]
m = 10
p = 30
k = 0
for i in range(n):
if mass[i] > m:
mass[i] = p
k += 1
print(mass, k)
Объяснение: