Skip to content · ⁨דלג לתוכן⁩

Star triangle · ⁨משולש כוכבים⁩

English

Star triangle

Print a triangle of stars four rows high: one star, then two, then three, then four.

Multiplying a string repeats it: "ab" * 3 is "ababab". Let the loop variable say how many stars each row needs.

עברית

משולש כוכבים

הדפיסו משולש כוכבים בגובה ארבע שורות: כוכב אחד, אז שניים, אז שלושה, אז ארבעה.

כפל של מחרוזת חוזר אותה: "ab" * 3 הוא "ababab". הניחו למשתנה הלולאה לקבוע כמה כוכבים צריך כל שורה.

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

IGCSE, A-Level & AP