All challenges

Thursday, 10 September 2026

Past

Three rungs, one idea. Solving rung 1 counts. Climb as far as you can.

Building Star Rows

loops + building strings

Rung 1Daily goal5 points

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

InputOutput
3"***"
0""
1"*"
5"*****"

There are extra hidden tests, so make it work in general, not just for these.

Rung 2Bonus7 points

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

InputOutput
3["*", "**", "***"]
0[]
1["*"]
4["*", "**", "***", "****"]

There are extra hidden tests, so make it work in general, not just for these.

Rung 3Bonus10 points

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

InputOutput
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.