标签:+= 乘法表 orm print range 表达 end code form
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("")
标签:+= 乘法表 orm print range 表达 end code form
原文地址:http://blog.51cto.com/13842013/2165421