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's max.

เก็บค่าที่ดีที่สุดที่พบมาจนถึงปัจจุบัน, เริ่มจากไอเท็มแรก. เดินผ่านรายการและแทนที่ค่าที่ดีที่สุดทุกครั้งที่เจอค่าที่ใหญ่กว่า. เมื่อลูปสิ้นสุด, ค่าที่ดีที่สุดคือค่าที่ใหญ่ที่สุด

Log in or create account · ⁨เข้าสู่ระบบหรือสร้างบัญชี⁩

IGCSE, A-Level & AP