使用 for 迴圈畫出㇐個金字塔
num=5
for i in range(1,num):
for j in range(1,num-i):
print(" ",end="")
for j in range(1,2*i):
print("*",end="")
print("\n")
num=5
for i in range(1,num):
for j in range(1,num-i):
print(" ",end="")
for j in range(1,2*i):
print("*",end="")
print("\n")
熱門評論