Upside-down triangle · 逆三角形
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · このページには最新のブラウザ(SharedArrayBuffer対応)が必要です。Chrome、Edge、Firefox、Safariを最新バージョンに更新してください。
This one builds on a lesson you haven't finished yet. Do that lesson first: · これはまだ完了していないレッスンの先にある内容です。まずはそのレッスンを済ませてください:
Python Basics · Counting loops · カウントループ →
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 となります。
Print a triangle of stars that shrinks: ****, then ***, then **, then *. · 星印の三角形を縮小して表示してください:****、次は***、次は**、最後に*。
Click Run to see the output here. · 実行ボタンをクリックして出力を確認してください。