print("==============================")
l = [0,1,2,3,4,3,2,1,0]
b = [' '*(int(len(l)/2)-i)+"*"*(2*i+1) for i in l]
for i in b:
print(i)
icon.png
print("==============================")
l = [0,1,2,3,4,3,2,1,0]
b = [' '*(int(len(l)/2)-i)+"*"*(2*i+1) for i in l]
for i in b:
print(i)
icon.png
本文标题:python基础-菱形打印
本文链接:https://www.haomeiwen.com/subject/dqbelqtx.html
网友评论