Star 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
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". הניחו למשתנה הלולאה לקבוע כמה כוכבים צריך כל שורה.
Print a triangle of stars with 4 rows: *, **, ***, ****. Use a loop and "*" * n. · הדפס משולש כוכבים בעל 4 שורות: *, **, ***, ****. השתמש במעגל וב-"*" * n.
Click Run to see the output here. · לחץ על הרץ כדי לראות את התוצא כאן.