Skip to content · ⁨Passer au contenu⁩

Upside-down triangle · ⁨Triangle inversé⁩

English

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.

Français

Triangle inversé

Imprimez quatre rangées d'étoiles, en commençant par quatre et en finissant par une.

range compte à rebours avec un pas négatif : range(3, 0, -1) produit 3, 2, 1. Il s'arrête toujours avant son deuxième argument, c'est pourquoi la valeur d'arrêt est 0.

Log in or create account · ⁨Se connecter ou créer un compte⁩

IGCSE, A-Level & AP