for i in range(1, 10):
for j in range(1, i + 1):
print(i, “*”, j, “=”, i * j, end=" ")
print()
# print(i)
x = 1
while x < 10:
y = 1
while y <= x:
print(x, “*”, y, “=”, x * y, end=" ")
y += 1
print()
x += 1
用while单层循环实现9 * 9 乘法表
i = 1
j = 1
while i < 10:
if j <= i:
print(i, “*”, j, “=”, i * j, end=" ")
j += 1
else:
j = 1
i += 1
print()