Count the letters · عد الأحرف
Count the letters
word is "banana". Use a for loop to count its letters into n. Do not use len.
A counter lives outside the loop (so it is not reset every turn) and grows inside it. That shape — set up, loop, use — comes back constantly.
عد الحروف
الكلمة word هي "banana". استخدم حلقة for لعد حروفها في n. لا تستخدم len.
عداد يعيش خارج الحلقة (لكي لا يُعاد تعيينه في كل دورة) وينمو داخلها. هذا الشكل — إعداد، حلقة، استخدام — يعود باستمرار.
word is "banana". Use a for loop to count its letters into n. Do not use len. · الكلمة word هي "banana". استخدم حلقة for لعد حروفها في n. لا تستخدم len.
Click Run to see the output here. · اضغط تشغيل لرؤية المخرجات هنا.