九九乘法表python的表达方法-成都快上网建站

九九乘法表python的表达方法

row = 1

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

    print("")
    row += 1


for row in range(1, 10):
    for col in range(1, row+1):
        print("{} * {} = {}".format(col, row, row*col), end="\t\t")
    print("")


row = 1

while row <= 9:
    col = 1
    while col <= row:
        print("{} * {} = {}" .format (col, row, row*col), end="\t\t")
        col += 1

    print("")
    row += 1

for row in range(1, 10):
    for col in range(1, row+1):
        print("%d * %d = %d"% (col, row, row*col), end="\t\t")
    print("")

分享题目:九九乘法表python的表达方法
当前URL:http://kswjz.com/article/jisopd.html
扫二维码与项目经理沟通

我们在微信上24小时期待你的声音

解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流