Largest without max · maxを使わず最大値を求める
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
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を使わない最大値
Pythonのmaxを使用せずに、リスト内の最大値を返します。
最初の項目から始めて、これまでに見つけた最良の値を保持します。リストを巡り、より大きい値に出会った每次都替えます。ループ終了時、この最良の値が最大値となります。
Write largest(nums) that returns the largest number in the list, without using max. · リストの中で最大の数を返すlargest(nums)を書いてください。maxは使用しないでください。
Click Run to see the output here. · 実行ボタンをクリックして出力を確認してください。