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

Urban Unit Official Training Confirmation Email & Dates 2025

Dengue Fever: Comprehensive Guide on Prevention, Treatment, and Health Guidelines

Describe the process of microteaching by focusing its reflective nature in the development of novice teachers. What is the role of supervisor in this process?

University of Veterinary & Animal Sciences UVAS Swat

Write a program to calculate the sum of all elements in a list using a for loop using Python

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

Indian BSF soldier arrested on Pakistani soil by Pak Rangers

Warning! Avoid Fraudulent Job Offers

Find Maximum and Minimum from List using Python

Rescue 1122 Punjab Jobs 2025 For Multiple Categories