while嵌套应用二:九九乘法表

python学习网 2018-07-22 18:05:02
__author__ = 'zht'
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
#努力学习每一天
'''


#while嵌套应用二:九九乘法表
i = 1

while i <= 9:
    j = 1
    while j <= i:
        print("%d*%d=%-5d"%(j,i,i*j),end='')
        j +=1
    print('\n')
    i+=1

 

阅读(2688) 评论(0)