Star triangle · مثلث النجوم
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. · اضغط تشغيل لرؤية المخرجات هنا.