成都创新互联网站制作重庆分公司

九九乘法表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的表达方法
分享网址:http://cxhlcq.com/article/jisopd.html

其他资讯

在线咨询

微信咨询

电话咨询

028-86922220(工作日)

18980820575(7×24)

提交需求

返回顶部