Unit 2 Task 48: Star triangle banner

Learn to code with step-by-step lessons. A place for students to work through programming fundamentals and build skills.

Unit 2 Task 48 - Star triangle banner

← Unit 2 tasks · Solution


Ask for n. Print n lines: line 1 has one *, line 2 has two *, …, line n has n stars (no spaces between stars on a line is fine).

Use nested loops or string multiplication ("*" * k).

Skills: for inside for, or for + print("*" * i).