import random
array = []
for _ in range(5):
b = [random.randint(0, 9) for _ in range(5)]
array.append(b)
for row in array:
for num in row:
print(num, end = ' ')
print()
print('Первый столбец:')
print(row[0], end = ' ')
print('Последний столбец:')
print(row[len(row) - 1], end = ' ')
import random
array = []
for _ in range(5):
b = [random.randint(0, 9) for _ in range(5)]
array.append(b)
for row in array:
for num in row:
print(num, end = ' ')
print()
print('Первый столбец:')
for row in array:
print(row[0], end = ' ')
print()
print('Последний столбец:')
for row in array:
print(row[len(row) - 1], end = ' ')