for i in range(1,10): k=10-i for j in range(i,10): l=10-j print(str...
print('倒三角形')for i in range(9,0,-1): space=print(' '*(9-i),end='') for j in range(1,i+1):...
#乘法口诀表正序for i in range(1,10): for j in range(1,i+1): print(str(i)+'*'+str(j)+'='...
99乘法表for i in range(1,10):
for j in range(1,i+1):
print(str(j)+'×'+str(i)+'='+str(i*j),end='\t')
print()倒序99乘法表for i in ran...
def space(i,j): if i*j>=10: return "" elif i*j
#正序乘法表for i in range(0, 10): for j in range(1, i + 1): print(str(i)+"*"+str(j)+"="+str(i*j)+" ", end="...
#正序乘法表for i in range(0, 10): for j in range(1, i + 1): print(str(i)+"*"+str(j)+"="+str(i*j)+" ", end="...
for i in range(9,0,-1): for j in range(i,0,-1): print(str(i)+"*"+str(j)+"="+str(i*j)+" ",end="") print()
将乘法表的数字存入到一个列表中,将列表转换为字典,提高运行速度。使用字典比列表运行速度快的原因: Python 字典中使用了 hash table,因此查找操作...
先看一下运行效果图:实现步骤:Step1: 创建两个空的list变量,分别表示乘法公式里的两个乘数Step2:For循环,range(1, 10),用list的append方法给两个li...
>>> for i in range(1,10): for j in range(1,i+1): print(str(i)+"*"+str(j)+"="+str(i*j)+" ",en...
示例:1、正向输出for i in range(1,10): for j in range(1,i+1): print(str(i)+"*"+str(j)+"="+str(i*j)+" ",end=...
for i in reversed(range(1,10)): for j in reversed(range(1, i+1)): print(str(i) + "*" + str(j) + "=" + str(i * j), end=" ") print()