30、一行代码实现9*9乘法表 print('\n'.join([''.join(['%s*%s=%-2s'% (y,x,x*y)foryinrange(1,x+1)])forxinrange(1,10)]))
一行代码实现9*9乘法表 6 7 # for i in range(1, 10): # for j in range(1, i + 1): # print('%s * %s = %s ' % (i, j, i * j), end='') # print() [print('%s * %s = %s\n'%(i, j, i*j))ifi==jelseprint('%s * %s = %s '%(i, j, i*j), end='')fori...
一行代码实现9*9乘法表 print("\n".join("\t".join(["%s*%s=%s"%(x,y,x*y)foryinrange(1,x+1)])
python一行代码实现9x9乘法表 foriinrange(1,10): forjinrange(1,i+1): print('%s * %s = %s '%(i,j,i*j),end="") print() print('\n'.join(['\t'.join(["%2s*%2s=%2s"%(j,i,i*j)forjinrange(1,i+1)])foriinrange(1,10)]))...