โ Back to Printing
Question 57
Print a Right Triangle
Print a Right Triangle
Use a loop and the .repeat() method to print a right triangle of stars with 4 rows. Row i has i stars. Expected output: * ** *** ****
Expected Output:
* ** *** ****
Topics:
Printing
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (clog, fn, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.