while 条件:
条件满足时,做的事情1
条件满足时,做的事情2
条件满足时,做的事情3
...(省略)...
*
* *
* * *
* * * *
* * * * *
i = 1
while i <= 5:
j = 1
while j <= i:
print("* ", end = '')
j += 1
print("\n")
i += 1
# 九九乘法表
i = 1
while i<=9:
j=1
while j<=i:
print("%d*%d=%-2d " % (j, i, i*j), end = '')
j+=1
print('\n')
i+=1