Average of a list · متوسط قائمة
Average of a list
Return the mean of a list: the total divided by how many numbers there are.
len(nums) tells you how many items the list has. Dividing with / always gives a decimal, so the average of 1 and 2 is 1.5.
متوسط قائمة
أعد المتوسط الحسابي لقائمة: المجموع الكلي مقسومًا على عدد الأرقام.
يخبرك len(nums) بعدد عناصر القائمة. القسمة باستخدام / تعطي دائمًا كسرًا عشريًا، لذا فإن متوسط 1 و 2 هو 1.5.
Write average(nums) that returns the mean: the total divided by how many numbers there are. The list is never empty. · اكتب average(nums) ترجع المتوسط: المجموع مقسومًا على عدد الأرقام. القائمة لن تكون فارغة أبدًا.
Click Run to see the output here. · اضغط تشغيل لرؤية المخرجات هنا.