from builtins import range
from pip._vendor.distlib.compat import raw_input
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
输出 9*9 乘法口诀表
'''
'''
乘法口诀这玩意没啥好说的,当初学习java时不知写了多少遍了,
'''
def test01(num):
for i in range(1,num+1):
for j in range(1,i+1):
print("%d*%d=%d" % (j, i, i*j),end=" ")
print("")
def test02(num):
for i in range(1,num+1):
for j in range(1,i+1):
print('{}*{}={}'.format(j, i, i*j),end=" ")
print("")
num=raw_input("请输入:");
num=int(num)
test01(num)
test02(num)
python学习08:乘法表
最新推荐文章于 2019-10-25 10:58:35 发布