from random import randint
mat = []
for i in range(5):
mat.append([])
for ii in range(5):
mat[i].append(randint(-10, 10))
for i in range(len(mat)):
for ii in range(len(mat[i])):
if ii % 2 == 0:
mat[i][ii] = 0
else:
mat[i][ii] = 1
for i in mat:
print(*i)
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
from random import randint
mat = []
for i in range(5):
mat.append([])
for ii in range(5):
mat[i].append(randint(-10, 10))
for i in range(len(mat)):
for ii in range(len(mat[i])):
if ii % 2 == 0:
mat[i][ii] = 0
else:
mat[i][ii] = 1
for i in mat:
print(*i)