Upside-down triangle · مثلث مقلوب
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.
مثلث مقلوب
اطبع أربعة صفوف من النجوم، بدءًا من أربعة وانتهاءً بواحد.
يعمل 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. · اضغط تشغيل لرؤية المخرجات هنا.