info_outline

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

Extend your previous solution to include a third parameter "order" which can be either `"ASC"` or `"DESC`. Depending of the order provided, the pyramid will be displayed in ascending order (`"ASC"`) or descending order (`"DESC"`). Examples:

A pyramid with 5 levels ASC:

``````nested_pyramid(5, '*', 'ASC')
*
**
****
*****
******
``````

A pyramid with 5 levels DESC:

``````nested_pyramid(5, '*', 'DESC')
*****
****
***
**
*
``````

A pyramid with 3 levels ASC:

``````nested_pyramid(5, '#', 'ASC')
#
##
###
``````

A pyramid with 3 levels DESC:

``````nested_pyramid(5, '@', 'DESC')
@@@
@@
@
``````

### Test Cases

test descending pyramid -

``````desc_pyramid = """
xxxxxxx
xxxxxx
xxxxx
xxxx
xxx
xx
x
""".lstrip()

def test_descending_pyramid():
assert advanced_nested_pyramid(7, 'x', 'DESC') == desc_pyramid
``````

test ascending pyramid -

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

def test_ascending_pyramid():
assert advanced_nested_pyramid(5, '#', 'ASC') == pyramid_5_expected
``````