Largest without max · Le plus grand sans 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.
Plus grand sans max
Retourne le plus grand nombre d'une liste sans utiliser la fonction Python max.
Conservez la meilleure valeur trouvée jusqu'ici, en commençant par le premier élément. Parcourez la liste et remplacez la meilleure valeur chaque fois que vous rencontrez un nombre plus grand. Quand la boucle se termine, la meilleure valeur est le plus grand.
Write largest(nums) that returns · rendements the largest number in the list, without using max. · Écrivez largest(nums) qui retourne le plus grand nombre dans la liste, sans utiliser max.
Click Run to see the output here. · Cliquez sur Exécuter pour voir le résultat ici.