Upside-down triangle · Triángulo invertido
Upside-down triangle
Print four rows of stars, starting with four and ending with one.
range counts backwards with a negative step: range(3, 0, -1) gives 3, 2, 1. It still stops before its second number, which is why the stop value is 0.
Triángulo invertido
Imprime cuatro filas de asteriscos, comenzando con cuatro y terminando con uno.
range cuenta hacia atrás con un paso negativo: range(3, 0, -1) produce 3, 2, 1. Todavía se detiene antes de su segundo número; por eso el valor de parada es 0.
Print a triangle of stars that shrinks: ****, then ***, then **, then *. · Imprime un triángulo de asteriscos que se reduzca: ****, luego ***, luego **, luego *.
Click Run to see the output here. · Haz clic en Ejecutar para ver la salida aquí.