from random import randint
a = [randint(-12,12) for _ in range(9)]
print(*a)
for i, elem in enumerate(a):
if elem == 2:
a[i] = 1
print(*a, sep='\n')
Объяснение:
from random import randint
a = [randint(-12,12) for _ in range(9)]
print(*a)
for i, elem in enumerate(a):
if elem == 2:
a[i] = 1
print(*a, sep='\n')
Объяснение: