1.while 循环 :
代码语言:javascript
复制x = 1
while x < 10:
y = 1
while y <=x:
print('%d*%d=-' % (y,x,x*y),end = 't')
y = 1
x = 1
print('n')
2.for 循环:
代码语言:javascript
复制for i in range(1,10):
for k in range(1,i 1): #排除结果相同的表达式,如1*2和2*1
print('%d*%d=-' % (k,i,i*k),end = 't')
print('n')