1 import string 2 for x in xrange(1,10): 3 for y in xrange(1,x+1): 4 print string.ljust("%d*%d = " %(y,x) + str(y*x), 10), 5 print
输出结果:
时间: 2024-10-11 06:28:32
1 import string 2 for x in xrange(1,10): 3 for y in xrange(1,x+1): 4 print string.ljust("%d*%d = " %(y,x) + str(y*x), 10), 5 print
输出结果: