def pyramid(height: int): for i in range(height): print(' ' * (int((2 * height - 1)/2) - i) + '*' * (2 * i + 1)) pyramid(5)