info_outline

Solutions will be available when this assignment is resolved, or after a few failing attempts.

Nested Pyramid

Write a function nested_pyramid that receives a number height and a character char and builds an ASCII Pyramid with them. Examples:

A pyramid with 5 levels:

nested_pyramid(5, '*')
*
**
****
*****
******

A pyramid with 3 levels:

nested_pyramid(5, '#')
#
##
###

Test Cases

test pyramid with 5 levels - Run Test

pyramid_5_expected = """
#
##
###
####
#####
""".lstrip()


def test_pyramid_with_5_levels():
    assert nested_pyramid(5, '#') == pyramid_5_expected

test pyramid with 3 levels - Run Test

pyramid_3_expected = """
@
@@
@@@
""".lstrip()


def test_pyramid_with_3_levels():
    assert nested_pyramid(3, '@') == pyramid_3_expected
def nested_pyramid(height, char): pass