Back to Practice
#0215
Increasing Number Triangle
EasyPython15 min10 XP
Problem
For n, return a list of strings for the number triangle: first row "1", second row "12", and so on.
Why This Matters
Number patterns check whether loop indexes map correctly to visible output.
Function Signature
def number_triangle(n):
Examples
Example 1
Inputn = 4
Output["1", "12", "123", "1234"]
Row 4 contains numbers 1 through 4 joined together.
Constraints
- Return the exact requested value.
- Handle small edge cases cleanly.
- Prefer readable Python over clever shortcuts.
CodePython
Visible browser tests run here when available.
Testcases1 visible / 3 hidden categories
Core example
Inputn = 4
Expected["1", "12", "123", "1234"]
Row 4 contains numbers 1 through 4 joined together.
Hidden Test Categories
small inputlarger inputedge shape