ENع
الدرس 06 · Basics

Loops

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

A loop runs the same lines of code again and again, so you write a job once and let Python repeat it. Step through a four-line program, loop.py, that adds up the list [1, 2, 3] with a for loop: watch the loop variable take each item in turn, the indented body run once per item, and the total grow from 0 to 6. Finish with range(), which counts for you, and a look at the while loop.

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

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