Lets start off by looking at how we can take what we learned about data types to return an array of strings that represent a triangle. The simplest case could be
results = []
results.append(" *")
results.append(" ***")
results.append("*****")
results
While this works, what if we want the size of the triangle when there are 4, 5 or 6 lines? To solve for these different cases looking at loops and using variables for the number of spaces and stars could be a solution that easily allows the code to handle different sizes of triangles.
This is the expected result: It should match the actual result.
* *** *****