Skip to content · ⁨コンテンツへスキップ⁩

Upside-down triangle · ⁨逆三角形⁩

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.

日本語

逆三角形

4個から始めて1個で終わる、4行分の星印を出力します。

range は負のステップで逆順にカウントします: range(3, 0, -1) は 3, 2, 1 を生成します。二番目の数字の直前で停止するため、停止値は 0 となります。

Log in or create account · ⁨ログインまたはアカウント作成⁩

IGCSE, A-Level & AP