Star triangle
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version.
Star triangle
Print a triangle of stars four rows high: one star, then two, then three, then four.
Multiplying a string repeats it: "ab" * 3 is "ababab". Let the loop variable say how many stars each row needs.
Print a triangle of stars with 4 rows: *, **, ***, ****. Use a loop and "*" * n.
Click Run to see the output here.