python九九乘法表代码
作者:野牛程序员:2024-01-10 16:54:04python阅读 2485
方法一:
s = "" for i in range(1, 10): for j in range(1, i + 1): s += f"{j} × {i} = {i * j}\\t" s += "\\n" print(s)
方法二:
i = 1 while i <= 9: j = 1 while j <= i: print(f"{j} × {i} = {j * i}\\t", end='') j += 1 i += 1 print()
野牛程序员教少儿编程与信息学奥赛-微信|电话:15892516892