Number Triangle
Completed
Read n and print a triangle where row i contains the numbers 1 to i separated by spaces.
Input
One integer.
Output
n rows.
Example
Input
4
Output
1 1 2 1 2 3 1 2 3 4
Editor
Python
Hints
The inner range depends on the outer loop variable.
Solution explanation
The row number controls how long each row is.
Show solution
n = int(input())
for i in range(1, n + 1):
print(*range(1, i + 1))