ENع
الدرس 10 · Collections and functions

Functions

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

A function is a named group of steps you write once and run whenever you need it. Step through a seven-line program, avg.py, that defines average(nums) and calls it twice: watch def store the function, each call hand in a list and get its own call frame, the body work out the answer, and return send one value back to the line that asked. Finish with the most common slip: forget return and you get None.

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

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