python基础-菱形打印
2018-12-28 本文已影响0人
feitry
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