Count the positives · عد الموجبات
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · تحتاج هذه الصفحة إلى متصفح حديث (يدعم SharedArrayBuffer). يرجى تحديث Chrome أو Edge أو Firefox أو Safari إلى أحدث إصدار.
This one builds on a lesson you haven't finished yet. Do that lesson first: · هذا يعتمد على درس لم تكمله بعد. قم بذلك الدرس أولاً:
Python Basics · أساسيات بايثون · Functions · الدوال →
English
Count the positives
Return how many numbers in a list are greater than 0. Zero itself does not count.
A counter starts at 0 and grows by 1 each time the condition is true.
العربية
عد الموجبات
أعد عدد الأرقام في القائمة التي تساوي أكثر من 0. الصفر نفسه لا يُحسب.
يبدأ العداد عند 0 ويزداد بمقدار 1 في كل مرة يكون فيها الشرط صحيحًا.
Write count_positive(nums) that returns how many numbers in the list are greater than 0. · اكتب count_positive(nums) ترجع كم عدد الأرقام في القائمة التي هي أكبر من 0.
Click Run to see the output here. · اضغط تشغيل لرؤية المخرجات هنا.