Thursday, 10 September 2026
PastThree rungs, one idea. Solving rung 1 counts. Climb as far as you can.
Building Star Rows
loops + building strings
One row of stars
Write a function called star_row
Return a string made of n star characters, where n is 0 or bigger. So 3 gives "***", and 0 gives an empty string.
Examples
| Input | Output |
|---|---|
| 3 | "***" |
| 0 | "" |
| 1 | "*" |
| 5 | "*****" |
There are extra hidden tests, so make it work in general, not just for these.
A whole triangle
Write a function called star_triangle
Return a list of strings: the first row has 1 star, the second has 2, and so on down to n stars. 3 gives ["*", "**", "***"], and 0 gives an empty list. Handy trick: "*" * 3 is "***".
Examples
| Input | Output |
|---|---|
| 3 | ["*", "**", "***"] |
| 0 | [] |
| 1 | ["*"] |
| 4 | ["*", "**", "***", "****"] |
There are extra hidden tests, so make it work in general, not just for these.
Push it to the right
Write a function called padded_triangle
Same triangle, but every row must be exactly n characters long, with spaces in front of the stars so the stars line up on the right. 3 gives [" *", " **", "***"]. 0 gives an empty list.
Examples
| Input | Output |
|---|---|
| 3 | [" *", " **", "***"] |
| 0 | [] |
| 1 | ["*"] |
| 2 | [" *", "**"] |
There are extra hidden tests, so make it work in general, not just for these.
Finish Rung 1 and today counts. Rungs 2 and 3 are there if you want to push further.