标签归档 python推导

通过seo圣人

python推导乘法口诀表源码

python推导乘法口诀表源码如下:

#推导乘法口诀表
print('\n'.join(['\t'.join(['{}×{}={}'.format(j,i,j*i) for j in range(1, i+1)]) for i in range(1,10)]))

python推导乘法口诀表截图如下:

python用for循环打印乘法口诀表:

for x in range(1,10):
    for y in range(1,x+1):
        print('{}+{}={}\t'.format(x,y,x+y),end='')
    print()