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 · בסיסי Python · 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.
עברית
משולש הפוך
הדפץ ארבע שורות כוכבים, החל מארבע ועד לאחד.
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. · לחץ על הרץ כדי לראות את התוצא כאן.