Largest without max · الأكبر بدون دالة max
Largest without max
Return the largest number in a list without using Python's max.
Keep the best value found so far, starting with the first item. Walk through the list and replace the best value whenever you meet a bigger one. When the loop ends, the best value is the largest.
الأكبر بدون max
أعد أكبر رقم في قائمة دون استخدام دالة max الخاصة بـ Python.
احتفظ بأفضل قيمة تم العثور عليها حتى الآن، بدءًا من العنصر الأول. تجول عبر القائمة واستبدل أفضل قيمة كلما واجهت قيمة أكبر. عندما تنتهي الحلقة، تكون أفضل قيمة هي الأكبر.
Write largest(nums) that returns the largest number in the list, without using max. · اكتب largest(nums) ترجع أكبر رقم في القائمة، دون استخدام max.
Click Run to see the output here. · اضغط تشغيل لرؤية المخرجات هنا.