arr = [[9 * i + j + 1 for j in range(9)] for i in range(5)]
print('\n'.join([''.join([str(f'{i:3}') for i in row]) for row in arr]))
for j in range(9):
summa = 0
if j % 2 == 0:
for i in range(5):
summa += arr[i][j]
print(f'сумма столбца {j} равна {summa}')
Объяснение:
arr = [[9 * i + j + 1 for j in range(9)] for i in range(5)]
print('\n'.join([''.join([str(f'{i:3}') for i in row]) for row in arr]))
for j in range(9):
summa = 0
if j % 2 == 0:
for i in range(5):
summa += arr[i][j]
print(f'сумма столбца {j} равна {summa}')
Объяснение: