Lesson 10 of 23

Nested Loops: Patterns

10 min 30 XP

বাইরের loop rows সামলায় আর ভেতরের loop প্রতিটি row-র অক্ষর print করে। Campus test-এ pyramid আর diamond খুব জনপ্রিয়।

Example: edit me and press Run

Output Loading C (first time takes a few seconds)
Press Run to see the result here.

Pyramid-এ row r-এ (n - r)-টি space এবং (2r - 1)-টি star থাকে। আগে তালিকা বানান, তারপর loops লিখুন।

Challenge

+30 XP

n পড়ে এই উল্টো ত্রিভুজ print করুন (n = 4): **** *** ** *

Output Loading C (first time takes a few seconds)
Press Run to see the result here.