fb pixel

Create a triangle

Modify the function to return a 2D list which itself represents a triangle filled with the same symbol passed to the function. The function should accept two arguments - the height of the triangle and the symbol which needs to be filled in that triangle. If there is no value provided, the triangle needs to be filled with #.
Input
3 *

Output
[['*'], 
 ['*', '*'], 
 ['*', '*', '*']]
Input
2

Output
[['#'], 
 ['#', '#']]
 
To check your solution you need to sign in
Sign in to continue