python编程实例之星号*组成图案输出
(1)
for i in range(1,9):
for j in range(1,i+1):
print("* ",end="")
print()
(2)
for i in range(1,9):
for j in range(1,10-i):
print("* ",end="")
print()
(3)
for i in range(1,9):
print(" "*(16-2*i),end="")
for j in range(1,i+1):
print("* ",end="")
print()
(4)
for i in range(1,9):
print(" "*(8-i),end="")
for j in range(1,i+1):
print("* ",end="")
print()