Python常用语句案例分析2:用循环语句while嵌套实现九九乘法表

i = 1
while i < 10:
    j = 1
    while j <= i:
        print("%d*%d=%-2d " % (i, j, i * j), end='')
        j += 1
    print("\n")
    i += 1

猜你喜欢

转载自blog.csdn.net/weixin_41524411/article/details/89503751