while和for循环的运用:
#字符串换行输出
a=“asedrtszdfht122132687”
i=0
line=1
js=1
while i<len(a):
print(a[i],end="")
if line==js:
js=0
print()
line+=1
js+=1
i+=1
#打印三角形输出
i=1
while i<6:
j=1
while j<=i:
print("@",end=" “)
j+=1
i+=1
print()
for i in range(4):
for j in range(4):
print(”@",end=" ")
print()

#打印九九乘法表
i=1
while i<10:
j=1
while j<=i:
print("{}{}={}\t".format(j,i,ij),end="")
j+=1
i+=1
print()
运行结果:
基础知识点

相关文章:

  • 2022-01-13
  • 2021-08-13
  • 2021-07-15
  • 2021-09-21
  • 2021-07-26
  • 2022-01-11
猜你喜欢
  • 2022-12-23
  • 2021-12-26
  • 2021-08-24
  • 2021-11-27
  • 2021-12-17
相关资源
相似解决方案