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
Imprima quatro linhas de asteriscos, começando com quatro e terminando com um.
range conta regressivamente com passo negativo: range(3, 0, -1) produz 3, 2, 1. Ele ainda para antes do seu segundo número, por isso o valor de parada é 0.
Print a triangle of stars that shrinks: ****, then ***, then **, then *. · Imprima um triângulo de estrelas que diminui: ****, depois ***, depois **, depois *.
Click Run to see the output here. · Clique em Executar para ver a saída aqui.