python实现乘法表
#!/usr/bin/env python# !_*_ coding:utf-8 _*_"""@version: python2.7@license: Apache Licence@contact: longzinziyan@gmail.com@site: http://blog.csdn.net/dielian520@time: 18-2-7 下午6:21"""i = 1
·
#!/usr/bin/env python # !_*_ coding:utf-8 _*_ """ @version: python2.7 @license: Apache Licence @contact: longzinziyan@gmail.com @site: http://blog.csdn.net/dielian520 @time: 18-2-7 下午6:21 """ i = 1 while i <= 9: j = 1 while j <= i: print '%d * %d = %-2d' % (j, i, i * j), if i != j: print ' ', j += 1 print '' i += 1 for i in range(1, 10): for j in range(1, i + 1): print '%d * %d = %-2d' % (j, i, i * j), if i != j: print ' ', print ''
更多推荐
已为社区贡献2条内容
所有评论(0)