docker学习仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
275 B

2 years ago
import sys
def print_pyramid(level: int):
for i in range(level):
new_line_str = ''
new_line_str += ' ' * (level - 1 - i)
new_line_str += '*' * ((i+1) * 2 - 1)
print(new_line_str)
input_level = int(sys.argv[1])
print_pyramid(input_level)