Discussions Events Study Material Jobs
Find Maximum and Minimum from List using Python - Uniwaly

Explore Diverse Conversations

Find Maximum and Minimum from List using Python

Posted By: UmairMehmood Published On: 13 June 2025 At: 11:45 AM

Write a program to find the maximum and minimum values from a list without using built-in max() or min().
numbers = [23, 5, 67, 12, 99, 34, 8, 76, 1, 50]

maximum = numbers[0]
minimum = numbers[0]

i = 1
while i < len(numbers):
    if numbers[i] > maximum:
        maximum = numbers[i]
    if numbers[i] < minimum:
        minimum = numbers[i]
    i += 1
print("Maximum value is:", maximum)
print("Minimum value is:", minimum)


Tags:

python python maximum value python minimum value python code
Login to like

Posted By:

Author Profile

UmairMehmood

11 days ago

Join the conversation!

Login to Comment

Discover More Articles

Charge Your Electric Car Just in 5 Minutes - New Achievement

Superior University Admission Process

Monitoring and Evaluation Officer Jobs in Punjab

Personality development occurs in life but later years provides an opportunity for the modification of previously development trends. Discuss.

Heavy Industries Taxila Education City Jobs 2025 - Teachers & Others HITEC Latest Jobs

Schedule of assessment for the post of Enforcement officer and Investigation officer 2025

Divisional Manager - The Urban Unit Jobs 2025

What is a NullPointerException, and how do I fix it?

Create a Frequency Dictionary from a Sentence using Python

Find the Largest Among Three Numbers Using Python