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.

עברית

משולש הפוך

הדפץ ארבע שורות כוכבים, החל מארבע ועד לאחד.

range סופר אחורה עם צעד שלילי: range(3, 0, -1) נותן 3, 2, 1. הוא עדיין עצור לפני המספר השני שלו, ולכן ערך העצירה הוא 0.

Log in or create account · ⁨היכנס או צור חשבון⁩

IGCSE, A-Level & AP