python 打印9*9乘法表

# -*- coding: utf8 -*-
# Author:wxq

1for i in range(1,10):
    for j in range(1,i+1):
        print "%d*%d=%2d"%(i,j,i*j),
    print ("")

2、==============
for i in range(1,10):
    for k in  range(1,10-i):
        print ("   "),
        for j in range(1,i+1):
            print "%d*%d=%2d"%(i,j,i*j),
        print ("")

3、==================
for i in range(1,10):
    for k in range(1,10-i):
        print ("      "),
    for j in range(1,i+1):
        print "%d*%d=%2d"%(i,j,i*j),
    print ("")

 

posted @ 2017-04-14 17:12  大象无形01  阅读(316)  评论(0编辑  收藏  举报