Python小代码_1_九九乘法表

2023-03-07,,

Python小代码_1_九九乘法表

max_num = 9
row = 1
while row <= max_num:
col = 1
while col <= row:
print(str(col) + "*" + str(row) + "=" + str(col*row), end="\t")
col += 1
row += 1
print()

for i in range(1, 10):
for j in range(1, i+1):
print('{0}*{1}={2}'.format(i, j, i*j).ljust(6), end=' ')
print()

Python小代码_1_九九乘法表的相关教程结束。

《Python小代码_1_九九乘法表.doc》

下载本文的Word格式文档,以方便收藏与打印。