"""
使用while嵌套循环输出如下图形:
*
* *
* * *
* * * *
* * * * *
"""
num = 1
while num <= 5:
j = 1
while j <= num:
print("*",end="")
j += 1
print() # 换行
num += 1
"""
使用while嵌套循环输出如下图形:
*
* *
* * *
* * * *
* * * * *
"""
num = 1
while num <= 5:
j = 1
while j <= num:
print("*",end="")
j += 1
print() # 换行
num += 1
本文标题:python -08-打印图形*
本文链接:https://www.haomeiwen.com/subject/gtdikftx.html
网友评论