{"id":114443,"date":"2025-12-17T12:25:30","date_gmt":"2025-12-17T06:55:30","guid":{"rendered":"https:\/\/www.mygreatlearning.com\/blog\/?page_id=114443"},"modified":"2025-12-17T12:16:07","modified_gmt":"2025-12-17T06:46:07","slug":"min-max-finder-program-using-list","status":"publish","type":"page","link":"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/min-max-finder-program-using-list\/","title":{"rendered":"Python Min Max Finder Program Using Lists"},"content":{"rendered":"\n<link rel=\"stylesheet\" href=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/codemirror\/5.65.16\/codemirror.min.css\" \/>\n<link rel=\"stylesheet\" href=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/codemirror\/5.65.16\/theme\/eclipse.min.css\" \/>\n<link rel=\"stylesheet\" href=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/font-awesome\/6.4.0\/css\/all.min.css\">\n\n<style>\n    \/* Wrapper to protect styles *\/\n    .py-receipt-wrapper {\n        \/* Local CSS Variables *\/\n        --py-bg-app: #f9fafb;\n        --py-bg-panel: #ffffff;\n        --py-border: #e5e7eb;\n        --py-text-primary: #1f2937;\n        --py-text-secondary: #6b7280;\n        --py-primary-blue: #2563eb;\n        --py-primary-hover: #1d4ed8;\n        --py-header-height: 50px;\n        --py-footer-height: 60px;\n\n        font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n        background-color: var(--py-bg-app);\n        color: var(--py-text-primary);\n        width: 100%;\n        border: 1px solid var(--py-border);\n        box-sizing: border-box;\n\n        \/* --- LAYOUT FIXES --- *\/\n        display: flex;            \n        flex-direction: column;   \n        min-height: 85vh;         \n    }\n\n    .py-receipt-wrapper * { box-sizing: border-box; }\n\n    \/* --- TOP NAV --- *\/\n    .py-receipt-top-nav {\n        display: flex;\n        align-items: center;\n        justify-content: space-between;\n        height: var(--py-header-height);\n        padding: 0 20px;\n        background: var(--py-bg-panel);\n        border-bottom: 1px solid var(--py-border);\n        min-width: 100%;\n    }\n    .py-receipt-nav-title {\n        font-weight: 600;\n        color: var(--py-text-secondary);\n        font-size: 14px;\n    }\n\n    \/* --- LAYOUT --- *\/\n    .py-receipt-ide-container {\n        display: flex; \n        flex: 1; \n        height: auto;\n        min-width: 100%;\n        background: white;\n        overflow: hidden; \n    }\n\n    \/* --- LEFT PANE --- *\/\n    .py-receipt-left-pane {\n        width: 45%; \n        border-right: 1px solid var(--py-border);\n        background: var(--py-bg-panel); \n        display: flex; \n        flex-direction: column;\n    }\n\n    .py-receipt-tabs-header {\n        height: var(--py-header-height); \n        border-bottom: 1px solid var(--py-border);\n        display: flex; \n        align-items: center; \n        padding: 0 20px; \n        gap: 25px;\n        font-size: 14px; \n        font-weight: 500; \n        color: var(--py-text-secondary);\n    }\n    \n    .py-receipt-tab-item { cursor: pointer; padding: 14px 0; border-bottom: 2px solid transparent; }\n    .py-receipt-tab-item.active { color: var(--py-text-primary); border-bottom-color: var(--py-primary-blue); }\n    .py-receipt-tab-item:hover { color: var(--py-text-primary); }\n\n    .py-receipt-pane-content { flex: 1; overflow-y: auto; padding: 25px; display: none; }\n    .py-receipt-pane-content.active { display: block; }\n\n    \/* Typography *\/\n    .py-receipt-wrapper h1 { margin-top: 0; font-size: 22px; font-weight: 600; color: var(--py-text-primary); margin-bottom: 1rem; }\n    .py-receipt-wrapper p { line-height: 1.6; color: #374151; margin-bottom: 1rem; }\n    .py-receipt-wrapper ul { margin-bottom: 20px; color: #374151; line-height: 1.6; padding-left: 20px; }\n    .py-receipt-wrapper li { margin-bottom: 5px; }\n    .py-receipt-wrapper h3 { font-size: 16px; margin-top: 15px; margin-bottom: 10px; }\n\n    .py-receipt-solution-block {\n        background: #f8f9fa; border: 1px solid var(--py-border); padding: 15px;\n        border-radius: 6px; font-family: 'Consolas', monospace; font-size: 14px;\n        color: #333; white-space: pre-wrap; overflow-x: auto;\n    }\n\n    .py-receipt-sample-box { background-color: #f3f4f6; border: 1px solid var(--py-border); border-radius: 6px; margin-top: 20px; overflow: hidden; }\n    .py-receipt-sample-header { display: flex; background-color: #e5e7eb; font-size: 13px; font-weight: 600; color: var(--py-text-primary); }\n    .py-receipt-sample-col-title { width: 50%; padding: 8px 15px; border-right: 1px solid #d1d5db; }\n    .py-receipt-sample-col-content { width: 50%; padding: 15px; font-family: 'Consolas', monospace; font-size: 14px; border-right: 1px solid var(--py-border); white-space: pre-wrap; color: #333; }\n    .py-receipt-sample-body { display: flex; }\n\n    \/* --- RIGHT PANE --- *\/\n    .py-receipt-right-pane {\n        width: 55%; display: flex; flex-direction: column; background: var(--py-bg-panel);\n    }\n\n    .py-receipt-editor-top-bar {\n        height: var(--py-header-height); border-bottom: 1px solid var(--py-border);\n        display: flex; align-items: center; justify-content: space-between;\n        padding: 0 15px; background-color: #f9fafb;\n    }\n\n    .py-receipt-lang-label { font-weight: 600; font-size: 14px; background: #e5e7eb; padding: 4px 12px; border-radius: 4px; }\n    .py-receipt-editor-settings i { color: var(--py-text-secondary); margin-left: 15px; cursor: pointer; font-size: 16px; }\n\n    .py-receipt-code-area { flex: 1; display: flex; flex-direction: column; position: relative; }\n    .py-receipt-code-area .CodeMirror { flex: 1; height: 100%; position: absolute; top: 0; bottom: 0; left: 0; right: 0; font-family: 'Source Code Pro', monospace; font-size: 15px; }\n\n    .py-receipt-console-section {\n        border-top: 1px solid var(--py-border); background: #f9fafb;\n        display: flex; flex-direction: column; height: 35%;\n    }\n    .py-receipt-console-header { padding: 8px 15px; background: #e5e7eb; font-size: 12px; font-weight: 600; color: var(--py-text-secondary); text-transform: uppercase; }\n    .py-receipt-console-body { display: flex; flex: 1; overflow: hidden; }\n    .py-receipt-input-wrapper, .py-receipt-output-wrapper { flex: 1; display: flex; flex-direction: column; padding: 10px; border-right: 1px solid var(--py-border); }\n    .py-receipt-output-wrapper { border-right: none; }\n    .py-receipt-console-label { font-size: 12px; font-weight: 600; margin-bottom: 5px; color: var(--py-text-secondary); }\n    \n    textarea.py-receipt-custom-input-area { flex: 1; border: 1px solid var(--py-border); border-radius: 4px; resize: none; padding: 8px; font-family: monospace; width: 100%; }\n    \n    \/* MODIFIED: Adjusted line-height for better pattern alignment *\/\n    .py-receipt-output-display { \n        flex: 1; background: white; border: 1px solid var(--py-border); \n        border-radius: 4px; padding: 8px; font-family: monospace; \n        white-space: pre-wrap; overflow-y: auto; font-size: 13px; \n        line-height: 1.15; \/* Fix for gap between stars *\/\n    }\n\n    \/* --- FOOTER ACTIONS --- *\/\n    .py-receipt-footer-actions {\n        height: var(--py-footer-height);\n        border-top: 1px solid var(--py-border);\n        display: flex;\n        align-items: center;\n        justify-content: flex-end; \n        padding: 0 20px;\n        background-color: var(--py-bg-panel);\n    }\n\n    .py-receipt-execution-group { display: flex; gap: 12px; align-items: center; }\n\n    .py-receipt-btn {\n        padding: 8px 20px;\n        border-radius: 4px;\n        font-size: 14px;\n        font-weight: 600;\n        cursor: pointer;\n        text-decoration: none;\n        display: inline-flex;\n        align-items: center;\n        justify-content: center;\n        transition: 0.2s;\n        height: 38px;\n        box-shadow: none;\n        border: none;\n    }\n\n    .py-receipt-btn-secondary { background: transparent; border: 1px solid var(--py-border); color: var(--py-text-primary); }\n    .py-receipt-btn-secondary:hover { background: #f3f4f6; }\n\n    .py-receipt-btn-primary { background: var(--py-primary-blue); border: 1px solid var(--py-primary-blue); color: white; }\n    .py-receipt-btn-primary:hover { background: var(--py-primary-hover); }\n\n    .py-receipt-spinner {\n        display: none; width: 14px; height: 14px;\n        border: 2px solid #fff; border-top-color: transparent;\n        border-radius: 50%; animation: py-receipt-spin 0.8s linear infinite; margin-left: 8px;\n    }\n    @keyframes py-receipt-spin { 100% { transform: rotate(360deg); } }\n\n    .py-receipt-hidden { display: none !important; }\n    .py-receipt-btn-mobile { display: none !important; }\n\n    \/* --- MOBILE RESPONSIVE --- *\/\n    @media (max-width: 768px) {\n        .py-receipt-wrapper { display: block; height: auto; min-height: auto; }\n        .py-receipt-ide-container { flex: none; height: auto; }\n\n        .py-receipt-top-nav { display: none; }\n        .py-receipt-ide-container { flex-direction: column; overflow-y: auto; height: auto; }\n        .py-receipt-left-pane, .py-receipt-right-pane { width: 100%; height: auto; }\n        \n        .py-receipt-left-pane { \n            border-right: none; \n            border-bottom: 8px solid #f3f4f6; \n            min-height: auto;\n            max-height: 400px;\n        }\n        \n        .py-receipt-right-pane { display: flex; flex-direction: column; }\n        \n        .py-receipt-console-section, \n        .py-receipt-console-body,\n        .py-receipt-footer-actions { display: contents; }\n        \n        .py-receipt-console-header { display: none; }\n        .py-receipt-editor-top-bar { order: 1; }\n        \n        .py-receipt-code-area { \n            order: 2; height: 500px; flex: none; \n        } \n        .py-receipt-code-area .CodeMirror { position: relative; height: 500px; }\n\n        .py-receipt-input-wrapper { \n            order: 3; width: 100%; height: auto; min-height: 280px; \n            border-right: none; border-top: 8px solid #f3f4f6; border-bottom: 1px solid var(--py-border);\n        }\n\n        .py-receipt-execution-group {\n            order: 4; width: 100%; display: flex; padding: 15px; gap: 10px;\n            border-bottom: 1px solid var(--py-border); background: #fff;\n        }\n        .py-receipt-execution-group .py-receipt-btn { flex: 1; }\n        \n        .py-receipt-output-wrapper {\n            order: 5; width: 100%; height: auto; min-height: 300px; max-height: 500px;\n            border-right: none; background: #fff;\n        }\n\n        .py-receipt-btn-mobile {\n            display: inline-flex !important; order: 6; width: 48%; margin: 15px 1%;\n            box-sizing: border-box; text-align: center;\n        }\n        \n        a.py-receipt-hidden { display: none !important; }\n    }\n<\/style>\n\n<div class=\"py-receipt-wrapper\">\n    <div class=\"py-receipt-top-nav\">\n        <a id=\"py-minmax-btn-prev-top\" class=\"py-receipt-btn py-receipt-btn-secondary py-receipt-hidden\" href=\"#\">&larr; Previous<\/a>\n        <span class=\"py-receipt-nav-title\">Module 4: Lists & Tuples<\/span>\n        <a id=\"py-minmax-btn-next-top\" class=\"py-receipt-btn py-receipt-btn-primary py-receipt-hidden\" href=\"#\">Next &rarr;<\/a>\n    <\/div>\n\n    <div class=\"py-receipt-ide-container\" id=\"py-minmax-ideContainer\">\n        \n        <div class=\"py-receipt-left-pane\">\n            <div class=\"py-receipt-tabs-header\">\n                <div class=\"py-receipt-tab-item active\" onclick=\"pyMinMaxSwitchTab('statement')\">Statement<\/div>\n                <div class=\"py-receipt-tab-item\" onclick=\"pyMinMaxSwitchTab('solution')\">Solution<\/div>\n            <\/div>\n\n            <div id=\"py-minmax-tab-statement\" class=\"py-receipt-pane-content active\">\n                <h1 id=\"python-exercise-4-1-min-max-finder\">Python Exercise 4.1: Min\/Max Finder<\/h1>\n                <p>Lists are used to store multiple items in a single variable. Your task is to find the largest and smallest numbers in a list <strong>without<\/strong> using Python's built-in <code>min()<\/code> or <code>max()<\/code> functions.<\/p>\n                \n                <p>Your program should:<\/p>\n                <ul>\n                    <li>Create a list with at least 10 numbers (you can generate them randomly or hardcode them).<\/li>\n                    <li>Initialize a variable <code>minimum<\/code> and <code>maximum<\/code> using the first item in the list.<\/li>\n                    <li>Loop through the list starting from the second item.<\/li>\n                    <li>Update <code>minimum<\/code> if the current number is smaller.<\/li>\n                    <li>Update <code>maximum<\/code> if the current number is larger.<\/li>\n                    <li>Print the results.<\/li>\n                <\/ul>\n\n                <h3 id=\"sample-interaction\">Sample Interaction:<\/h3>\n                <div class=\"py-receipt-sample-box\">\n                    <div class=\"py-receipt-sample-header\">\n                        <div class=\"py-receipt-sample-col-title\">Input<\/div>\n                        <div class=\"py-receipt-sample-col-title\">Output<\/div>\n                    <\/div>\n                    <div class=\"py-receipt-sample-body\">\n                        <div class=\"py-receipt-sample-col-content\">(None)<\/div>\n                        <div class=\"py-receipt-sample-col-content\">List: [12, 45, 2, 67, 34, 89, 10, 5, 99, 23]\nSmallest Number: 2\nLargest Number: 99<\/div>\n                    <\/div>\n                <\/div>\n            <\/div>\n\n            <div id=\"py-minmax-tab-solution\" class=\"py-receipt-pane-content\">\n                <h1 id=\"solution\">Solution<\/h1>\n                <p>By comparing every number against our current \"best\" found so far, we can determine the min and max manually.<\/p>\n                <div class=\"py-receipt-solution-block\">import random\n\n# 1. Create a list of 10 random numbers (1-100)\nnumbers = []\nfor i in range(10):\n    numbers.append(random.randint(1, 100))\n\nprint(f\"List: {numbers}\")\n\n# 2. Initialize min and max with the first element\nminimum = numbers[0]\nmaximum = numbers[0]\n\n# 3. Iterate through the list\nfor num in numbers:\n    if num < minimum:\n        minimum = num\n    if num > maximum:\n        maximum = num\n\n# 4. Print results\nprint(f\"Smallest Number: {minimum}\")\nprint(f\"Largest Number: {maximum}\")<\/div>\n                \n                <p style=\"margin-top:20px\"><strong>Key Concepts:<\/strong><\/p>\n                <ul>\n                    <li><code>list[0]<\/code> accesses the first element.<\/li>\n                    <li><code>append()<\/code> adds items to the end of a list.<\/li>\n                    <li>We assume the first number is both the min and max until we find evidence to the contrary.<\/li>\n                <\/ul>\n            <\/div>\n        <\/div>\n\n        <div class=\"py-receipt-right-pane\">\n            <div class=\"py-receipt-editor-top-bar\">\n                <span class=\"py-receipt-lang-label\">Python 3<\/span>\n                <div class=\"py-receipt-editor-settings\">\n                    <i class=\"fas fa-expand\" id=\"py-minmax-fullscreenBtn\" title=\"Toggle Fullscreen\"><\/i>\n                <\/div>\n            <\/div>\n\n            <div class=\"py-receipt-code-area\">\n                <div id=\"py-minmax-code-editor-div\"><\/div>\n            <\/div>\n\n            <div class=\"py-receipt-console-section\">\n                <div class=\"py-receipt-console-header\">Test Console<\/div>\n                <div class=\"py-receipt-console-body\">\n                    <div class=\"py-receipt-input-wrapper\">\n                        <label class=\"py-receipt-console-label\">Custom Input (Stdin)<\/label>\n                        <textarea id=\"py-minmax-custom-input\" class=\"py-receipt-custom-input-area\" placeholder=\"No input needed...\" disabled style=\"background: #f3f4f6; color: #9ca3af;\"><\/textarea>\n                    <\/div>\n                    <div class=\"py-receipt-output-wrapper\">\n                        <label class=\"py-receipt-console-label\">Output<\/label>\n                        <div id=\"py-minmax-output-console\" class=\"py-receipt-output-display\">Run code to see output...<\/div>\n                    <\/div>\n                <\/div>\n            <\/div>\n\n            <div class=\"py-receipt-footer-actions\">\n                <a id=\"py-minmax-btn-prev-mobile\" class=\"py-receipt-btn py-receipt-btn-secondary py-receipt-hidden py-receipt-btn-mobile\" href=\"#\">&larr; Previous<\/a>\n\n                <div class=\"py-receipt-execution-group\">\n                    <button class=\"py-receipt-btn py-receipt-btn-secondary\" onclick=\"pyMinMaxResetCode()\">Reset<\/button>\n                    \n                    <button class=\"py-receipt-btn py-receipt-btn-primary\" onclick=\"pyMinMaxRunCode()\">\n                        <span id=\"py-minmax-btn-text\">Run Code<\/span>\n                        <span class=\"py-receipt-spinner\" id=\"py-minmax-btn-spinner\"><\/span>\n                    <\/button>\n                <\/div>\n\n                <a id=\"py-minmax-btn-next-mobile\" class=\"py-receipt-btn py-receipt-btn-primary py-receipt-hidden py-receipt-btn-mobile\" href=\"#\">Next &rarr;<\/a>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/div>\n\n<script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/codemirror\/5.65.16\/codemirror.min.js\"><\/script>\n<script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/codemirror\/5.65.16\/mode\/python\/python.min.js\"><\/script>\n<script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/codemirror\/5.65.16\/addon\/edit\/closebrackets.min.js\"><\/script>\n\n<script>\n    \/\/ --- EXERCISE 4.1: MIN\/MAX FINDER LOGIC ---\n    var pyMinMaxEditor; \n    var pyMinMaxStarterCode;\n\n    \/\/ --- 1. CONFIGURATION: EXERCISE LINKS ---\n    \/\/ Previous link points to Exercise 3.4 (Pattern Printing)\n    const pyMinMaxPrevLink = \"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/pyramid-pattern-printing-program\/\"; \n    const pyMinMaxNextLink = \"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/remove-duplicates-from-a-list\/\"; \n\n    \/\/ --- 2. Button Visibility Logic ---\n    document.addEventListener(\"DOMContentLoaded\", function() {\n        const prevBtnTop = document.getElementById('py-minmax-btn-prev-top');\n        const nextBtnTop = document.getElementById('py-minmax-btn-next-top');\n        const prevBtnMobile = document.getElementById('py-minmax-btn-prev-mobile');\n        const nextBtnMobile = document.getElementById('py-minmax-btn-next-mobile');\n\n        if (pyMinMaxPrevLink && pyMinMaxPrevLink.trim() !== \"\") {\n            prevBtnTop.href = pyMinMaxPrevLink;\n            prevBtnTop.classList.remove('py-receipt-hidden');\n            prevBtnMobile.href = pyMinMaxPrevLink;\n            prevBtnMobile.classList.remove('py-receipt-hidden');\n        }\n\n        if (pyMinMaxNextLink && pyMinMaxNextLink.trim() !== \"\") {\n            nextBtnTop.href = pyMinMaxNextLink;\n            nextBtnTop.classList.remove('py-receipt-hidden');\n            nextBtnMobile.href = pyMinMaxNextLink;\n            nextBtnMobile.classList.remove('py-receipt-hidden');\n        }\n    });\n\n    \/\/ --- 3. IDE Logic ---\n    function pyMinMaxSwitchTab(tabName) {\n        document.querySelectorAll('#py-minmax-tab-statement, #py-minmax-tab-solution').forEach(el => el.classList.remove('active'));\n        const headerTabs = document.querySelector('#py-minmax-ideContainer .py-receipt-tabs-header').children;\n        Array.from(headerTabs).forEach(el => el.classList.remove('active'));\n\n        document.getElementById('py-minmax-tab-' + tabName).classList.add('active');\n        \n        if(tabName === 'statement') headerTabs[0].classList.add('active');\n        if(tabName === 'solution') headerTabs[1].classList.add('active');\n    }\n\n    const pyMinMaxFullscreenBtn = document.getElementById('py-minmax-fullscreenBtn');\n    const pyMinMaxIdeContainer = document.getElementById('py-minmax-ideContainer');\n\n    if(pyMinMaxFullscreenBtn) {\n        pyMinMaxFullscreenBtn.addEventListener('click', () => {\n            if (!document.fullscreenElement) {\n                pyMinMaxIdeContainer.requestFullscreen().catch(err => alert(`Error: ${err.message}`));\n                pyMinMaxFullscreenBtn.classList.replace('fa-expand', 'fa-compress');\n            } else {\n                document.exitFullscreen();\n                pyMinMaxFullscreenBtn.classList.replace('fa-compress', 'fa-expand');\n            }\n        });\n    }\n\n    \/\/ --- STARTER CODE ---\n    pyMinMaxStarterCode = `# Exercise 4.1: Min\/Max Finder\n# Find largest and smallest numbers manually\nimport random\n\n# 1. Generate a list of random numbers\nnumbers = []\nfor i in range(10):\n    numbers.append(random.randint(1, 100))\n\nprint(f\"List: {numbers}\")\n\n# 2. Initialize min and max variables\n# Hint: Set them to the first number in the list\n# minimum = numbers[0]\n\n\n# 3. Loop through the list to compare\n# for num in numbers:\n\n\n    # 4. Update if smaller or larger\n\n\n# 5. Print the results\n`;\n\n    pyMinMaxEditor = CodeMirror(document.getElementById(\"py-minmax-code-editor-div\"), {\n        value: pyMinMaxStarterCode,\n        mode: \"python\",\n        theme: \"eclipse\",\n        lineNumbers: true,\n        indentUnit: 4,\n        autoCloseBrackets: true\n    });\n\n    function pyMinMaxResetCode() {\n        pyMinMaxEditor.setValue(pyMinMaxStarterCode);\n        document.getElementById(\"py-minmax-output-console\").innerText = \"Run code to see output...\";\n    }\n\n    function pyMinMaxRunCode() {\n        const spinner = document.getElementById('py-minmax-btn-spinner');\n        const btnText = document.getElementById('py-minmax-btn-text');\n        const outputBox = document.getElementById('py-minmax-output-console');\n        \n        spinner.style.display = \"inline-block\";\n        btnText.innerText = \"Running \";\n        outputBox.innerText = \"Processing...\";\n        outputBox.style.color = \"#6b7280\";\n\n        const pythonCode = pyMinMaxEditor.getValue();\n        \/\/ No user input needed for this one\n        const userInput = \"\"; \n\n        fetch(\"https:\/\/blogsupport123-python-compiler.hf.space\/api\/run-python\", {\n            method: \"POST\",\n            headers: { \"Content-Type\": \"application\/json\" },\n            body: JSON.stringify({ code: pythonCode, input: userInput }),\n        })\n        .then(response => response.json())\n        .then(data => {\n            if (data.output) {\n                outputBox.innerText = data.output;\n                outputBox.style.color = \"#1f2937\";\n            } else if (data.error || data.errors) {\n                outputBox.innerText = data.error || data.errors;\n                outputBox.style.color = \"#ef4444\";\n            } else {\n                outputBox.innerText = \"No output returned.\";\n            }\n        })\n        .catch(err => {\n            outputBox.innerText = \"Error: \" + err.message;\n            outputBox.style.color = \"#ef4444\";\n        })\n        .finally(() => {\n            spinner.style.display = \"none\";\n            btnText.innerText = \"Run Code\";\n        });\n    }\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>&larr; Previous Module 4: Lists &#038; Tuples Next &rarr; Statement Solution Python Exercise 4.1: Min\/Max Finder Lists are used to store multiple items in a single variable. Your task is to find the largest and smallest numbers in a list without using Python's built-in min() or max() functions. Your program should: Create a list with [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":114447,"parent":114145,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"_uag_custom_page_level_css":".ast-custom-footer{\n\tdisplay: none;\n}","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"full-width-container","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"disabled","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[25860],"tags":[36796,36895],"class_list":["post-114443","page","type-page","status-publish","has-post-thumbnail","hentry","category-software","tag-python","tag-python-exercise"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Python Min Max Finder Program Using Lists<\/title>\n<meta name=\"description\" content=\"Understand Python lists by building a min and max finder program. Practice loops, comparisons, and list indexing step by step.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/min-max-finder-program-using-list\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Min Max Finder Program Using Lists\" \/>\n<meta property=\"og:description\" content=\"Understand Python lists by building a min and max finder program. Practice loops, comparisons, and list indexing step by step.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/min-max-finder-program-using-list\/\" \/>\n<meta property=\"og:site_name\" content=\"Great Learning Blog: Free Resources what Matters to shape your Career!\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/GreatLearningOfficial\/\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/12\/python-min-max-finder-using-list.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1536\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@Great_Learning\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/python-exercise\\\/min-max-finder-program-using-list\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/python-exercise\\\/min-max-finder-program-using-list\\\/\"},\"author\":{\"name\":\"Great Learning Editorial Team\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\"},\"headline\":\"Python Min Max Finder Program Using Lists\",\"datePublished\":\"2025-12-17T06:55:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/python-exercise\\\/min-max-finder-program-using-list\\\/\"},\"wordCount\":252,\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/python-exercise\\\/min-max-finder-program-using-list\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/python-min-max-finder-using-list.webp\",\"keywords\":[\"python\",\"python-exercise\"],\"articleSection\":[\"IT\\\/Software Development\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/python-exercise\\\/min-max-finder-program-using-list\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/python-exercise\\\/min-max-finder-program-using-list\\\/\",\"name\":\"Python Min Max Finder Program Using Lists\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/python-exercise\\\/min-max-finder-program-using-list\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/python-exercise\\\/min-max-finder-program-using-list\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/python-min-max-finder-using-list.webp\",\"datePublished\":\"2025-12-17T06:55:30+00:00\",\"description\":\"Understand Python lists by building a min and max finder program. Practice loops, comparisons, and list indexing step by step.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/python-exercise\\\/min-max-finder-program-using-list\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/python-exercise\\\/min-max-finder-program-using-list\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/python-exercise\\\/min-max-finder-program-using-list\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/python-min-max-finder-using-list.webp\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/python-min-max-finder-using-list.webp\",\"width\":1536,\"height\":1024,\"caption\":\"Python Min Max Finder Program Using Lists\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/python-exercise\\\/min-max-finder-program-using-list\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python Exercises\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/python-exercise\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Python Min Max Finder Program Using Lists\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"name\":\"Great Learning Blog\",\"description\":\"Learn, Upskill &amp; Career Development Guide and Resources\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"alternateName\":\"Great Learning\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\",\"name\":\"Great Learning\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"width\":900,\"height\":900,\"caption\":\"Great Learning\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/GreatLearningOfficial\\\/\",\"https:\\\/\\\/x.com\\\/Great_Learning\",\"https:\\\/\\\/www.instagram.com\\\/greatlearningofficial\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/in.pinterest.com\\\/greatlearning12\\\/\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/beaconelearning\\\/\"],\"description\":\"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.\",\"email\":\"info@mygreatlearning.com\",\"legalName\":\"Great Learning Education Services Pvt. Ltd\",\"foundingDate\":\"2013-11-29\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"1001\",\"maxValue\":\"5000\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\",\"name\":\"Great Learning Editorial Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"caption\":\"Great Learning Editorial Team\"},\"description\":\"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.\",\"sameAs\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/\",\"https:\\\/\\\/in.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/Great_Learning\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCObs0kLIrDjX2LLSybqNaEA\"],\"award\":[\"Best EdTech Company of the Year 2024\",\"Education Economictimes Outstanding Education\\\/Edtech Solution Provider of the Year 2024\",\"Leading E-learning Platform 2024\"],\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/author\\\/greatlearning\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Python Min Max Finder Program Using Lists","description":"Understand Python lists by building a min and max finder program. Practice loops, comparisons, and list indexing step by step.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/min-max-finder-program-using-list\/","og_locale":"en_US","og_type":"article","og_title":"Python Min Max Finder Program Using Lists","og_description":"Understand Python lists by building a min and max finder program. Practice loops, comparisons, and list indexing step by step.","og_url":"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/min-max-finder-program-using-list\/","og_site_name":"Great Learning Blog: Free Resources what Matters to shape your Career!","article_publisher":"https:\/\/www.facebook.com\/GreatLearningOfficial\/","og_image":[{"width":1536,"height":1024,"url":"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/12\/python-min-max-finder-using-list.webp","type":"image\/webp"}],"twitter_card":"summary_large_image","twitter_site":"@Great_Learning","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/min-max-finder-program-using-list\/#article","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/min-max-finder-program-using-list\/"},"author":{"name":"Great Learning Editorial Team","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad"},"headline":"Python Min Max Finder Program Using Lists","datePublished":"2025-12-17T06:55:30+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/min-max-finder-program-using-list\/"},"wordCount":252,"publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/min-max-finder-program-using-list\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/12\/python-min-max-finder-using-list.webp","keywords":["python","python-exercise"],"articleSection":["IT\/Software Development"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/min-max-finder-program-using-list\/","url":"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/min-max-finder-program-using-list\/","name":"Python Min Max Finder Program Using Lists","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/min-max-finder-program-using-list\/#primaryimage"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/min-max-finder-program-using-list\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/12\/python-min-max-finder-using-list.webp","datePublished":"2025-12-17T06:55:30+00:00","description":"Understand Python lists by building a min and max finder program. Practice loops, comparisons, and list indexing step by step.","breadcrumb":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/min-max-finder-program-using-list\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/min-max-finder-program-using-list\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/min-max-finder-program-using-list\/#primaryimage","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/12\/python-min-max-finder-using-list.webp","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/12\/python-min-max-finder-using-list.webp","width":1536,"height":1024,"caption":"Python Min Max Finder Program Using Lists"},{"@type":"BreadcrumbList","@id":"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/min-max-finder-program-using-list\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/www.mygreatlearning.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Python Exercises","item":"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/"},{"@type":"ListItem","position":3,"name":"Python Min Max Finder Program Using Lists"}]},{"@type":"WebSite","@id":"https:\/\/www.mygreatlearning.com\/blog\/#website","url":"https:\/\/www.mygreatlearning.com\/blog\/","name":"Great Learning Blog","description":"Learn, Upskill &amp; Career Development Guide and Resources","publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"alternateName":"Great Learning","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mygreatlearning.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization","name":"Great Learning","url":"https:\/\/www.mygreatlearning.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","width":900,"height":900,"caption":"Great Learning"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/GreatLearningOfficial\/","https:\/\/x.com\/Great_Learning","https:\/\/www.instagram.com\/greatlearningofficial\/","https:\/\/www.linkedin.com\/school\/great-learning\/","https:\/\/in.pinterest.com\/greatlearning12\/","https:\/\/www.youtube.com\/user\/beaconelearning\/"],"description":"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.","email":"info@mygreatlearning.com","legalName":"Great Learning Education Services Pvt. Ltd","foundingDate":"2013-11-29","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"1001","maxValue":"5000"}},{"@type":"Person","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad","name":"Great Learning Editorial Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","caption":"Great Learning Editorial Team"},"description":"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.","sameAs":["https:\/\/www.mygreatlearning.com\/","https:\/\/in.linkedin.com\/school\/great-learning\/","https:\/\/x.com\/https:\/\/twitter.com\/Great_Learning","https:\/\/www.youtube.com\/channel\/UCObs0kLIrDjX2LLSybqNaEA"],"award":["Best EdTech Company of the Year 2024","Education Economictimes Outstanding Education\/Edtech Solution Provider of the Year 2024","Leading E-learning Platform 2024"],"url":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"}]}},"uagb_featured_image_src":{"full":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/12\/python-min-max-finder-using-list.webp",1536,1024,false],"thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/12\/python-min-max-finder-using-list-150x150.webp",150,150,true],"medium":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/12\/python-min-max-finder-using-list-300x200.webp",300,200,true],"medium_large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/12\/python-min-max-finder-using-list-768x512.webp",768,512,true],"large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/12\/python-min-max-finder-using-list-1024x683.webp",1024,683,true],"1536x1536":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/12\/python-min-max-finder-using-list.webp",1536,1024,false],"2048x2048":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/12\/python-min-max-finder-using-list.webp",1536,1024,false],"web-stories-poster-portrait":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/12\/python-min-max-finder-using-list-640x853.webp",640,853,true],"web-stories-publisher-logo":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/12\/python-min-max-finder-using-list-96x96.webp",96,96,true],"web-stories-thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2025\/12\/python-min-max-finder-using-list-150x100.webp",150,100,true]},"uagb_author_info":{"display_name":"Great Learning Editorial Team","author_link":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"},"uagb_comment_info":0,"uagb_excerpt":"&larr; Previous Module 4: Lists & Tuples Next &rarr; Statement Solution Python Exercise 4.1: Min\/Max Finder Lists are used to store multiple items in a single variable. Your task is to find the largest and smallest numbers in a list without using Python's built-in min() or max() functions. Your program should: Create a list with&hellip;","_links":{"self":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/pages\/114443","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/comments?post=114443"}],"version-history":[{"count":6,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/pages\/114443\/revisions"}],"predecessor-version":[{"id":114446,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/pages\/114443\/revisions\/114446"}],"up":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/pages\/114145"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media\/114447"}],"wp:attachment":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media?parent=114443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/categories?post=114443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/tags?post=114443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}