Skip to content · ⁨コンテンツへスキップ⁩

Largest without max · ⁨maxを使わず最大値を求める⁩

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を使用せずに、リスト内の最大値を返します。

最初の項目から始めて、これまでに見つけた最良の値を保持します。リストを巡り、より大きい値に出会った每次都替えます。ループ終了時、この最良の値が最大値となります。

Log in or create account · ⁨ログインまたはアカウント作成⁩

IGCSE, A-Level & AP