# ./sd.py
*
***
*****
*******
*********
|
[root@bogon shengdan]# vim sd.py
[root@bogon shengdan]# cat sd.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
height = 5
stars = 1
for i in range(height):
print((' ' * (height - i)) + ('*' * stars))
stars += 2
print((' ' * height) + '|')
[root@bogon shengdan]#