等腰三角形

num = int(input("请输入整数:"))
lst = []
count = num-1
for i in range(1, num*2):
if i% 2 != 0:
s = " ".join("*" * i).strip(" ")
lst.append(s)
while count >= 0:
print(" " * count*2 + lst[num-1-count])
count = count - 1
===================================
n = int(input("请输入行数:"))
for i in range(1, n+1):
for j in range(2*n-2*i):
print("", end=" ")
for k in range(1, 2*i):
print("*", end=" ")
print()
posted @ 2019-11-13 11:16  冰灬荷  阅读(208)  评论(0编辑  收藏  举报