Python基础(7)打印乘法表

'''for i in range(1,10):
    for j in range(1,10):
        print i,'*',j,'=',i*j,' ',
'''

'''
for a in range(1,10):
    for b in range(1,10):
        #print a,'*',b,'=',a*b,'',
        print '%d*%d=%d'%( a,b,a*b),
    print '\n'

for m in range(1,10):
    for n in range(1,m+1):
        print '%d*%d=%d'%(n,m,m*n),
    print '\n'
'''
for h in range(9,1,-1):
    
    for l in range(1,h):
        
        print '    ',
        print "%d*%d=%d"%(l,h,l*h),
    print '\n'

posted @ 2017-06-25 15:17  人间好时节  阅读(320)  评论(0编辑  收藏  举报