Star triangle · Triángulo de estrellas
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.
Triángulo de estrellas
Imprime un triángulo de estrellas de cuatro filas de altura: una estrella, luego dos, luego tres, luego cuatro.
Multiplicar una cadena la repite: "ab" * 3 es "ababab". Haz que la variable del bucle indique cuántas estrellas necesita cada fila.
Print a triangle of stars with 4 rows: *, **, ***, ****. Use a loop and "*" * n. · Imprime un triángulo de estrellas con 4 filas: *, **, ***, ****. Usa un bucle y "*" * n.
Click Run to see the output here. · Haz clic en Ejecutar para ver la salida aquí.