第1种方式: 使用for-for #九九乘法表foriinrange(1, 10):forjinrange(1, i+1):print(f'{j}x{i}={i*j}\t', end='')print() 第2种方式: 使用while-while #九九乘法表i = 1whilei <= 9: j= 1while(j <= i):print(f'{i}*{j}={i*j}', end='\t') j+= 1print('') i+= ...
用for循环打印九九乘法表: 1 2 3 4 5 6 for i in range (1,10): for j in range(1,10): print(j,"x",i,"=",i*j,"\t",end="") if i==j: print("") break 打印结果是: 1 2 3 4 5 6 7 8 9 1 x 1 = 1 1 x 2 = 2 2 x 2 = 4 1 x 3 = 3 2 x 3 = ...