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

Simple Number Guessing Game Using Python

10-Day PhD Interview Prep Series: Essential Questions & Answers

How to become a pro in CSS. A Road map to Becoming a CSS Pro.

Pension New Method Explained - Which Employees Not Eligible For Pension ?

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

Content Writing Prompt Using ChatGPT and DeepSeek

Social Mobilizer - The Urban Unit Jobs 2025

Virtual University of Pakistan Admission Process

Irrigation Department Bahawalpur Canal Division Jobs 2025

Explain the interrelationship of language skills. How does the classroom environment affect them?