← Back to Algorithm Review

Find the Minimum

3 of 4

Exercise 3: Find the Minimum in a List

πŸ“‹ Lists πŸ”‚ Loops

Your Task

Write a program that finds the minimum (smallest) number in a list. Do not use the built-in min() function β€” implement it yourself with a loop.

Example: [7, 2, 9, 1, 5, 3] β†’ minimum is 1

Use a variable to track the smallest value seen so far as you loop through the list.


Example Output

List: [7, 2, 9, 1, 5, 3]
Minimum: 1

Try it yourself

Code: Find the Minimum

Loading Python runtime…
Python …
Loading...
bash
$ Click "Run" to execute your code...