project-python3/lesson2.4_16.py
2025-12-15 14:14:56 +05:00

12 lines
446 B
Python

'''****** Задание ********
*Редизайн таблицы умножения.
'''
m, n = int(input()), int(input())
for i in range(1, m + 1):
for j in range(1, m + 1):
if j != m:
print(f'{(str(i * j) + " " if n % 2 else str(i * j)).center(n)}|', end='')
else:
print(f'{(str(i * j) + " " if n % 2 else str(i * j)).center(n)}')
if i * j != m * m:
print(f'{"-"* ((n + 1) * m - 1)}')