源程序如下:
a = [1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 1]
b = [' ' * 2 * (7 - i) + 'Good' * i for i in a]
for line in b:
print(line)
Good
GoodGood
GoodGoodGood
GoodGoodGoodGood
GoodGoodGoodGoodGood
GoodGoodGoodGoodGoodGood
GoodGoodGoodGoodGoodGoodGood
GoodGoodGoodGoodGoodGood
GoodGoodGoodGoodGood
GoodGoodGoodGood
GoodGoodGood
GoodGood
Good