python7_九九乘法表

row = 1

while row <= 9:

    col = 1

    while col <= row:

        result = col * row

        # print("*", end="")

        print("%d * %d = %d " % (col, row, col*row), end="\t")

        col += 1

    # print("%d" % row)

    print("")

    row += 1

# 遍历:

for i in range(1, 10):

    print()

    for j in range(1, i+1):

        print("%d * %d = %d" % (i, j, i*j), end="\t")

你可能感兴趣的:(python7_九九乘法表)