ENع
الدرس 08 · First steps in code

Loops: doing things again

لم يُترجم بعد؛ يُعرض باللغة الإنجليزية

Programs are good at doing the same thing many times without getting bored. A loop runs a block of lines again and again. Step through a short Python program: a for loop adds up 1 + 2 + 3 + 4, the highlight jumps back to the loop's first line after every pass, and the numbers in memory change each time. Then see a while loop stop when its condition turns False, and how break gets you out of a loop that would never end.

10 دقيقة10 خطوات5 أسئلةBeginner
شكل 8 · تفاعلي
جارٍ تحميل الرسم…
أو ← →

اختبار يتاح بعد الخطوة الأخيرة.