'''
Draw pyramid using recursive function.
'''
def pyramid(N, i=0):
    if N > 0:
        print((N - 1) * ' ' + '*' * (i * 2 + 1))
        pyramid(N - 1, i + 1)

'''
Draw pyramid using string
'''
def pyramid_in_string(base):
    for i in range(1, base+1, 2):
        print('{:^{}}'.format('*' * i, base))


if __name__ == '__main__':
    pyramid(5)
    pyramid_in_string(10)

7ad9e394feeb1407fcee22e2fc9aa2976f144e1e
<mask token>

<mask token>


def pyramid_in_string(base):
    for i in range(1, base + 1, 2):
        print('{:^{}}'.format('*' * i, base))


<mask token>

<mask token>


def pyramid(N, i=0):
    if N > 0:
        print((N - 1) * ' ' + '*' * (i * 2 + 1))
        pyramid(N - 1, i + 1)


<mask token>


def pyramid_in_string(base):
    for i in range(1, base + 1, 2):
        print('{:^{}}'.format('*' * i, base))


<mask token>

<mask token>


def pyramid(N, i=0):
    if N > 0:
        print((N - 1) * ' ' + '*' * (i * 2 + 1))
        pyramid(N - 1, i + 1)


<mask token>


def pyramid_in_string(base):
    for i in range(1, base + 1, 2):
        print('{:^{}}'.format('*' * i, base))


if __name__ == '__main__':
    pyramid(5)
    pyramid_in_string(10)

'''
Draw pyramid using recursive function.
'''
def pyramid(N, i=0):
    if N > 0:
        print((N - 1) * ' ' + '*' * (i * 2 + 1))
        pyramid(N - 1, i + 1)

'''
Draw pyramid using string
'''
def pyramid_in_string(base):
    for i in range(1, base+1, 2):
        print('{:^{}}'.format('*' * i, base))


if __name__ == '__main__':
    pyramid(5)
    pyramid_in_string(10)
