如何用Python写九九乘法表while循环for循环

时间:2024-10-12 04:03:43

1、方法一:for循环

2、打开pycharm,输入代码。for i in range(1,10): for m in range(1,i+1): print(f"{足毂忍珩i} * {m} = {i*m}",end=" ") print('')

如何用Python写九九乘法表while循环for循环

4、方法二:while循环

5、输入代码i = 1while i < 10: m = 1 嘛术铹砾while m <= i: print(f"{足毂忍珩i} * {m} = {i*m}",end=" ") m+=1 print("") i+=1

如何用Python写九九乘法表while循环for循环
© 2025 长短途
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com