Find Max and Min Number from a List in Python

Опубликовано: 03 Июнь 2026
на канале: Study Desk of Anand
56
3

🔍 Find Max and Min Number from a List in Python | Without Using Built-in Functions
In this video, you'll learn how to find the maximum and minimum number in a list using basic loop logic—without relying on Python's built-in max() or min() functions. This is a commonly asked question in interviews to test your understanding of loops and conditionals.

📌 What you'll learn:

How to initialize variables for comparison

How to loop through a list to find the largest and smallest elements

Best practices for clean and understandable code

Real-world example list: [34, 5, 67, 3, 89, 12, 45, 78, 90, 23]

🧠 Great for Python beginners and those preparing for logic-building or coding interviews.

🛠️ Code used in the video:


numbers = [34, 5, 67, 3, 89, 12, 45, 78, 90, 23]

Find max number
num = numbers[0]
for i in numbers:
if i greater than symbol num:
num = i
print(num)

Find min number
num = numbers[0]
for i in numbers:
if i less than symbol num:
num = i
print(num)
💡 Bonus tip: You can enhance this by writing a function to return both values at once!

👍 Like, 💬 Comment, 🔁 Share & 🔔 Subscribe for more Python logic-building tutorials and coding practice videos!

#Python #MaxMinFromList #PythonForBeginners #PythonCoding #PythonInterviewQuestions #LearnPython #PythonLoop #ListOperations #CodingChallenge #PythonCode