{"id":117691,"date":"2026-05-12T16:46:42","date_gmt":"2026-05-12T11:16:42","guid":{"rendered":"https:\/\/www.mygreatlearning.com\/blog\/?page_id=117691"},"modified":"2026-05-12T16:35:43","modified_gmt":"2026-05-12T11:05:43","slug":"python-program-library-management-system","status":"publish","type":"page","link":"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/python-program-library-management-system\/","title":{"rendered":"Python Program Library Management System"},"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    \/* --- FORCE HIDE SITE FOOTER --- *\/\nfooter, \n.site-footer, \n#colophon, \n#footer, \n.footer-area {\n    display: none !important;\n}\n    \/* --- OVERRIDE ASTRA THEME CONTAINER --- *\/\n.ast-container {\n    padding-left: 0;\n    padding-right: 0;\n    max-width: 100%;\n    width: 100%;\n}\n.entry-content[data-ast-blocks-layout] > * {\n    \/* max-width: var(--wp--custom--ast-content-width-size); *\/\n    max-width: 100% !important;\n    margin-left: 0;\n    margin-right: 0;\n}\n    .py-lib-wrapper {\n        --py-bg-app: #f9fafb; --py-bg-panel: #ffffff; --py-border: #e5e7eb;\n        --py-text-primary: #1f2937; --py-text-secondary: #6b7280;\n        --py-primary-blue: #2563eb; --py-primary-hover: #1d4ed8;\n        --py-header-height: 50px; --py-footer-height: 60px;\n        font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n        background-color: var(--py-bg-app); color: var(--py-text-primary);\n        width: 100%; border: 1px solid var(--py-border); box-sizing: border-box;\n        display: flex; flex-direction: column; min-height: 85vh;\n    }\n    .py-lib-wrapper * { box-sizing: border-box; }\n    .py-lib-top-nav {\n        display: flex; align-items: center; justify-content: space-between;\n        height: var(--py-header-height); padding: 0 20px;\n        background: var(--py-bg-panel); border-bottom: 1px solid var(--py-border); min-width: 100%;\n    }\n    .py-lib-nav-title { font-weight: 600; color: var(--py-text-secondary); font-size: 14px; }\n    .py-lib-ide-container { display: flex; flex: 1; height: auto; min-width: 100%; background: white; overflow: hidden; }\n    .py-lib-left-pane { width: 45%; border-right: 1px solid var(--py-border); background: var(--py-bg-panel); display: flex; flex-direction: column; }\n    .py-lib-tabs-header {\n        height: var(--py-header-height); border-bottom: 1px solid var(--py-border);\n        display: flex; align-items: center; padding: 0 20px; gap: 25px;\n        font-size: 14px; font-weight: 500; color: var(--py-text-secondary);\n    }\n    .py-lib-tab-item { cursor: pointer; padding: 14px 0; border-bottom: 2px solid transparent; }\n    .py-lib-tab-item.active { color: var(--py-text-primary); border-bottom-color: var(--py-primary-blue); }\n    .py-lib-tab-item:hover { color: var(--py-text-primary); }\n    .py-lib-pane-content { flex: 1; overflow-y: auto; padding: 25px; display: none; }\n    .py-lib-pane-content.active { display: block; }\n    .py-lib-wrapper h1 { margin-top: 0; font-size: 22px; font-weight: 600; color: var(--py-text-primary); margin-bottom: 1rem; }\n    .py-lib-wrapper p { line-height: 1.6; color: #374151; margin-bottom: 1rem; }\n    .py-lib-wrapper ul { margin-bottom: 20px; color: #374151; line-height: 1.6; padding-left: 20px; }\n    .py-lib-wrapper li { margin-bottom: 5px; }\n    .py-lib-wrapper h3 { font-size: 16px; margin-top: 15px; margin-bottom: 10px; }\n    .py-lib-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    .py-lib-sample-box { background-color: #f3f4f6; border: 1px solid var(--py-border); border-radius: 6px; margin-top: 20px; overflow: hidden; }\n    .py-lib-sample-header { display: flex; background-color: #e5e7eb; font-size: 13px; font-weight: 600; color: var(--py-text-primary); }\n    .py-lib-sample-col-title { width: 50%; padding: 8px 15px; border-right: 1px solid #d1d5db; }\n    .py-lib-sample-col-content { width: 50%; padding: 15px; font-family: 'Consolas', monospace; font-size: 13px; border-right: 1px solid var(--py-border); white-space: pre-wrap; color: #333; }\n    .py-lib-sample-body { display: flex; }\n    .py-lib-right-pane { width: 55%; display: flex; flex-direction: column; background: var(--py-bg-panel); }\n    .py-lib-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    .py-lib-lang-label { font-weight: 600; font-size: 14px; background: #e5e7eb; padding: 4px 12px; border-radius: 4px; }\n    .py-lib-editor-settings i { color: var(--py-text-secondary); margin-left: 15px; cursor: pointer; font-size: 16px; }\n    .py-lib-code-area { flex: 1; display: flex; flex-direction: column; position: relative; }\n    .py-lib-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    .py-lib-console-section { border-top: 1px solid var(--py-border); background: #f9fafb; display: flex; flex-direction: column; height: 35%; }\n    .py-lib-console-header { padding: 8px 15px; background: #e5e7eb; font-size: 12px; font-weight: 600; color: var(--py-text-secondary); text-transform: uppercase; }\n    .py-lib-console-body { display: flex; flex: 1; overflow: hidden; }\n    .py-lib-input-wrapper, .py-lib-output-wrapper { flex: 1; display: flex; flex-direction: column; padding: 10px; border-right: 1px solid var(--py-border); }\n    .py-lib-output-wrapper { border-right: none; }\n    .py-lib-console-label { font-size: 12px; font-weight: 600; margin-bottom: 5px; color: var(--py-text-secondary); }\n    textarea.py-lib-custom-input-area { flex: 1; border: 1px solid var(--py-border); border-radius: 4px; resize: none; padding: 8px; font-family: monospace; width: 100%; }\n    .py-lib-output-display { flex: 1; background: white; border: 1px solid var(--py-border); border-radius: 4px; padding: 8px; font-family: monospace; white-space: pre-wrap; overflow-y: auto; font-size: 13px; line-height: 1.15; }\n    .py-lib-footer-actions {\n        height: var(--py-footer-height); border-top: 1px solid var(--py-border);\n        display: flex; align-items: center; justify-content: flex-end;\n        padding: 0 20px; background-color: var(--py-bg-panel);\n    }\n    .py-lib-execution-group { display: flex; gap: 12px; align-items: center; }\n    .py-lib-btn {\n        padding: 8px 20px; border-radius: 4px; font-size: 14px; font-weight: 600;\n        cursor: pointer; text-decoration: none; display: inline-flex; align-items: center;\n        justify-content: center; transition: 0.2s; height: 38px; box-shadow: none; border: none;\n    }\n    .py-lib-btn-secondary { background: transparent; border: 1px solid var(--py-border); color: var(--py-text-primary); }\n    .py-lib-btn-secondary:hover { background: #f3f4f6; }\n    .py-lib-btn-primary { background: var(--py-primary-blue); border: 1px solid var(--py-primary-blue); color: white; }\n    .py-lib-btn-primary:hover { background: var(--py-primary-hover); }\n    .py-lib-spinner { display: none; width: 14px; height: 14px; border: 2px solid #fff; border-top-color: transparent; border-radius: 50%; animation: py-lib-spin 0.8s linear infinite; margin-left: 8px; }\n    @keyframes py-lib-spin { 100% { transform: rotate(360deg); } }\n    .py-lib-hidden { display: none !important; }\n    .py-lib-btn-mobile { display: none !important; }\n    @media (max-width: 768px) {\n        .py-lib-wrapper { display: block; height: auto; min-height: auto; }\n        .py-lib-ide-container { flex: none; height: auto; }\n        .py-lib-top-nav { display: none; }\n        .py-lib-ide-container { flex-direction: column; overflow-y: auto; height: auto; }\n        .py-lib-left-pane, .py-lib-right-pane { width: 100%; height: auto; }\n        .py-lib-left-pane { border-right: none; border-bottom: 8px solid #f3f4f6; min-height: auto; max-height: 400px; }\n        .py-lib-right-pane { display: flex; flex-direction: column; }\n        .py-lib-console-section, .py-lib-console-body, .py-lib-footer-actions { display: contents; }\n        .py-lib-console-header { display: none; }\n        .py-lib-editor-top-bar { order: 1; }\n        .py-lib-code-area { order: 2; height: 500px; flex: none; }\n        .py-lib-code-area .CodeMirror { position: relative; height: 500px; }\n        .py-lib-input-wrapper { order: 3; width: 100%; height: auto; min-height: 280px; border-right: none; border-top: 8px solid #f3f4f6; border-bottom: 1px solid var(--py-border); }\n        .py-lib-execution-group { order: 4; width: 100%; display: flex; padding: 15px; gap: 10px; border-bottom: 1px solid var(--py-border); background: #fff; }\n        .py-lib-execution-group .py-lib-btn { flex: 1; }\n        .py-lib-output-wrapper { order: 5; width: 100%; height: auto; min-height: 300px; max-height: 500px; border-right: none; background: #fff; }\n        .py-lib-btn-mobile { display: inline-flex !important; order: 6; width: 48%; margin: 15px 1%; box-sizing: border-box; text-align: center; }\n        a.py-lib-hidden { display: none !important; }\n    }\n<\/style>\n\n<div class=\"py-lib-wrapper\">\n    <div class=\"py-lib-top-nav\">\n        <a id=\"py-lib-btn-prev-top\" class=\"py-lib-btn py-lib-btn-secondary py-lib-hidden\" href=\"#\">&larr; Previous<\/a>\n        <span class=\"py-lib-nav-title\">Module 9: Inheritance &amp; Polymorphism<\/span>\n        <a id=\"py-lib-btn-next-top\" class=\"py-lib-btn py-lib-btn-primary py-lib-hidden\" href=\"#\">Next &rarr;<\/a>\n    <\/div>\n\n    <div class=\"py-lib-ide-container\" id=\"py-lib-ideContainer\">\n\n        <div class=\"py-lib-left-pane\">\n            <div class=\"py-lib-tabs-header\">\n                <div class=\"py-lib-tab-item active\" onclick=\"pyLibSwitchTab('statement')\">Statement<\/div>\n                <div class=\"py-lib-tab-item\" onclick=\"pyLibSwitchTab('solution')\">Solution<\/div>\n            <\/div>\n\n            <div id=\"py-lib-tab-statement\" class=\"py-lib-pane-content active\">\n                <h1 id=\"python-exercise-9-2-library-management\">Python Exercise 9.2: Library Management<\/h1>\n                <p>Put your OOP skills to work on a real-world system. Build a mini library that tracks books, members, and borrowing \u2014 using multiple classes that interact with each other.<\/p>\n\n                <p>Define three classes:<\/p>\n                <ul>\n                    <li><strong>Book<\/strong> \u2014 stores <code>title<\/code>, <code>author<\/code>, and an <code>is_available<\/code> flag (default <code>True<\/code>). Has a <code>__str__<\/code> method.<\/li>\n                    <li><strong>Member<\/strong> \u2014 stores <code>name<\/code> and a <code>borrowed_books<\/code> list (default empty). Has a <code>borrow(book)<\/code> method that marks the book unavailable and appends it to the member's list, rejecting if the book is already borrowed. Has a <code>return_book(book)<\/code> method that marks it available again and removes it from the list.<\/li>\n                    <li><strong>Library<\/strong> \u2014 stores a <code>books<\/code> list. Has <code>add_book(book)<\/code>, <code>show_available()<\/code> (prints all available books), and <code>show_all()<\/code> (prints every book with its status).<\/li>\n                <\/ul>\n\n                <h3 id=\"sample-interaction\">Sample Interaction:<\/h3>\n                <div class=\"py-lib-sample-box\">\n                    <div class=\"py-lib-sample-header\">\n                        <div class=\"py-lib-sample-col-title\">Input<\/div>\n                        <div class=\"py-lib-sample-col-title\">Output<\/div>\n                    <\/div>\n                    <div class=\"py-lib-sample-body\">\n                        <div class=\"py-lib-sample-col-content\">(None)<\/div>\n                        <div class=\"py-lib-sample-col-content\">--- Available Books ---\n\"1984\" by George Orwell\n\"Dune\" by Frank Herbert\n\"Sapiens\" by Yuval Noah Harari\n\nAlice borrows \"1984\"...\nAlice borrows \"Dune\"...\nBob tries to borrow \"1984\"...\nError: \"1984\" is not available.\n\n--- Available Books ---\n\"Sapiens\" by Yuval Noah Harari\n\nAlice returns \"1984\"...\n\n--- All Books ---\n\"1984\" by George Orwell [Available]\n\"Dune\" by Frank Herbert [Borrowed]\n\"Sapiens\" by Yuval Noah Harari [Available]<\/div>\n                    <\/div>\n                <\/div>\n            <\/div>\n\n            <div id=\"py-lib-tab-solution\" class=\"py-lib-pane-content\">\n                <h1 id=\"solution\">Solution<\/h1>\n                <p>Each class has a single, clear responsibility. <code>Library<\/code> manages the catalogue; <code>Member<\/code> manages borrowing state; <code>Book<\/code> tracks its own availability.<\/p>\n                <div class=\"py-lib-solution-block\">class Book:\n    def __init__(self, title, author):\n        self.title = title\n        self.author = author\n        self.is_available = True\n\n    def __str__(self):\n        return f'\"{self.title}\" by {self.author}'\n\n\nclass Member:\n    def __init__(self, name):\n        self.name = name\n        self.borrowed_books = []\n\n    def borrow(self, book):\n        if not book.is_available:\n            print(f'Error: \"{book.title}\" is not available.')\n            return\n        book.is_available = False\n        self.borrowed_books.append(book)\n        print(f'{self.name} borrows \"{book.title}\"...')\n\n    def return_book(self, book):\n        if book in self.borrowed_books:\n            book.is_available = True\n            self.borrowed_books.remove(book)\n            print(f'{self.name} returns \"{book.title}\"...')\n\n\nclass Library:\n    def __init__(self):\n        self.books = []\n\n    def add_book(self, book):\n        self.books.append(book)\n\n    def show_available(self):\n        print(\"--- Available Books ---\")\n        for book in self.books:\n            if book.is_available:\n                print(book)\n\n    def show_all(self):\n        print(\"--- All Books ---\")\n        for book in self.books:\n            status = \"Available\" if book.is_available else \"Borrowed\"\n            print(f\"{book} [{status}]\")\n\n\n# Demo\nb1 = Book(\"1984\", \"George Orwell\")\nb2 = Book(\"Dune\", \"Frank Herbert\")\nb3 = Book(\"Sapiens\", \"Yuval Noah Harari\")\n\nlib = Library()\nlib.add_book(b1)\nlib.add_book(b2)\nlib.add_book(b3)\n\nalice = Member(\"Alice\")\nbob   = Member(\"Bob\")\n\nlib.show_available()\nprint()\n\nalice.borrow(b1)\nalice.borrow(b2)\nbob.borrow(b1)       # should fail\nprint()\n\nlib.show_available()\nprint()\n\nalice.return_book(b1)\nprint()\n\nlib.show_all()<\/div>\n\n                <p style=\"margin-top:20px\"><strong>Key Concepts:<\/strong><\/p>\n                <ul>\n                    <li><strong>Composition<\/strong> \u2014 <code>Library<\/code> holds a list of <code>Book<\/code> objects; <code>Member<\/code> holds a list of borrowed <code>Book<\/code> objects. Classes work together without inheriting from each other.<\/li>\n                    <li>Mutating an object's attribute (<code>book.is_available = False<\/code>) inside one class is immediately visible to all other classes holding a reference to the same object.<\/li>\n                    <li>Guard clauses keep methods short and readable \u2014 check for error conditions first and return early.<\/li>\n                    <li><code>list.remove(item)<\/code> removes the first matching object from a list.<\/li>\n                    <li>The <code>in<\/code> operator works on lists of objects, checking by identity\/equality.<\/li>\n                <\/ul>\n            <\/div>\n        <\/div>\n\n        <div class=\"py-lib-right-pane\">\n            <div class=\"py-lib-editor-top-bar\">\n                <span class=\"py-lib-lang-label\">Python 3<\/span>\n                <div class=\"py-lib-editor-settings\">\n                    <i class=\"fas fa-expand\" id=\"py-lib-fullscreenBtn\" title=\"Toggle Fullscreen\"><\/i>\n                <\/div>\n            <\/div>\n            <div class=\"py-lib-code-area\">\n                <div id=\"py-lib-code-editor-div\"><\/div>\n            <\/div>\n            <div class=\"py-lib-console-section\">\n                <div class=\"py-lib-console-header\">Test Console<\/div>\n                <div class=\"py-lib-console-body\">\n                    <div class=\"py-lib-input-wrapper\">\n                        <label class=\"py-lib-console-label\">Custom Input (Stdin)<\/label>\n                        <textarea id=\"py-lib-custom-input\" class=\"py-lib-custom-input-area\" placeholder=\"No input needed...\" disabled style=\"background: #f3f4f6; color: #9ca3af;\"><\/textarea>\n                    <\/div>\n                    <div class=\"py-lib-output-wrapper\">\n                        <label class=\"py-lib-console-label\">Output<\/label>\n                        <div id=\"py-lib-output-console\" class=\"py-lib-output-display\">Run code to see output...<\/div>\n                    <\/div>\n                <\/div>\n            <\/div>\n            <div class=\"py-lib-footer-actions\">\n                <a id=\"py-lib-btn-prev-mobile\" class=\"py-lib-btn py-lib-btn-secondary py-lib-hidden py-lib-btn-mobile\" href=\"#\">&larr; Previous<\/a>\n                <div class=\"py-lib-execution-group\">\n                    <button class=\"py-lib-btn py-lib-btn-secondary\" onclick=\"pyLibResetCode()\">Reset<\/button>\n                    <button class=\"py-lib-btn py-lib-btn-primary\" onclick=\"pyLibRunCode()\">\n                        <span id=\"py-lib-btn-text\">Run Code<\/span>\n                        <span class=\"py-lib-spinner\" id=\"py-lib-btn-spinner\"><\/span>\n                    <\/button>\n                <\/div>\n                <a id=\"py-lib-btn-next-mobile\" class=\"py-lib-btn py-lib-btn-primary py-lib-hidden py-lib-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    var pyLibEditor;\n    var pyLibStarterCode;\n\n    const pyLibPrevLink = \"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/python-program-employee-system-implementation\";\n    const pyLibNextLink = \"\";\n\n    document.addEventListener(\"DOMContentLoaded\", function() {\n        const prevBtnTop    = document.getElementById('py-lib-btn-prev-top');\n        const nextBtnTop    = document.getElementById('py-lib-btn-next-top');\n        const prevBtnMobile = document.getElementById('py-lib-btn-prev-mobile');\n        const nextBtnMobile = document.getElementById('py-lib-btn-next-mobile');\n        if (pyLibPrevLink && pyLibPrevLink.trim() !== \"\") {\n            prevBtnTop.href = pyLibPrevLink; prevBtnMobile.href = pyLibPrevLink;\n            prevBtnTop.classList.remove('py-lib-hidden'); prevBtnMobile.classList.remove('py-lib-hidden');\n        }\n        if (pyLibNextLink && pyLibNextLink.trim() !== \"\") {\n            nextBtnTop.href = pyLibNextLink; nextBtnMobile.href = pyLibNextLink;\n            nextBtnTop.classList.remove('py-lib-hidden'); nextBtnMobile.classList.remove('py-lib-hidden');\n        }\n    });\n\n    function pyLibSwitchTab(tabName) {\n        document.querySelectorAll('#py-lib-tab-statement, #py-lib-tab-solution').forEach(el => el.classList.remove('active'));\n        const headerTabs = document.querySelector('#py-lib-ideContainer .py-lib-tabs-header').children;\n        Array.from(headerTabs).forEach(el => el.classList.remove('active'));\n        document.getElementById('py-lib-tab-' + tabName).classList.add('active');\n        if (tabName === 'statement') headerTabs[0].classList.add('active');\n        if (tabName === 'solution')  headerTabs[1].classList.add('active');\n    }\n\n    const pyLibFullscreenBtn = document.getElementById('py-lib-fullscreenBtn');\n    const pyLibIdeContainer  = document.getElementById('py-lib-ideContainer');\n    if (pyLibFullscreenBtn) {\n        pyLibFullscreenBtn.addEventListener('click', () => {\n            if (!document.fullscreenElement) {\n                pyLibIdeContainer.requestFullscreen().catch(err => alert(`Error: ${err.message}`));\n                pyLibFullscreenBtn.classList.replace('fa-expand', 'fa-compress');\n            } else {\n                document.exitFullscreen();\n                pyLibFullscreenBtn.classList.replace('fa-compress', 'fa-expand');\n            }\n        });\n    }\n\n    pyLibStarterCode = `# Exercise 9.2: Library Management\n# Build Book, Member, and Library classes to track borrowing\n\n# \u2500\u2500 CLASS 1: Book \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n# class Book:\n#     def __init__(self, title, author):\n#         self.title = ...\n#         self.author = ...\n#         self.is_available = True   # all books start available\n#\n#     def __str__(self):\n#         # return: '\"1984\" by George Orwell'\n#         ...\n\n\n# \u2500\u2500 CLASS 2: Member \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n# class Member:\n#     def __init__(self, name):\n#         self.name = ...\n#         self.borrowed_books = []\n#\n#     def borrow(self, book):\n#         # Reject if book.is_available is False\n#         # Otherwise: mark unavailable, append to borrowed_books, print message\n#         ...\n#\n#     def return_book(self, book):\n#         # Mark available, remove from borrowed_books, print message\n#         ...\n\n\n# \u2500\u2500 CLASS 3: Library \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n# class Library:\n#     def __init__(self):\n#         self.books = []\n#\n#     def add_book(self, book):\n#         ...\n#\n#     def show_available(self):\n#         # Print \"--- Available Books ---\" then each available book\n#         ...\n#\n#     def show_all(self):\n#         # Print \"--- All Books ---\" then each book with [Available] or [Borrowed]\n#         ...\n\n\n# \u2500\u2500 DEMO \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n# b1 = Book(\"1984\", \"George Orwell\")\n# b2 = Book(\"Dune\", \"Frank Herbert\")\n# b3 = Book(\"Sapiens\", \"Yuval Noah Harari\")\n#\n# lib = Library()\n# lib.add_book(b1); lib.add_book(b2); lib.add_book(b3)\n#\n# alice = Member(\"Alice\")\n# bob   = Member(\"Bob\")\n#\n# lib.show_available()\n# print()\n# alice.borrow(b1)\n# alice.borrow(b2)\n# bob.borrow(b1)        # should fail \u2014 already borrowed\n# print()\n# lib.show_available()\n# print()\n# alice.return_book(b1)\n# print()\n# lib.show_all()\n`;\n\n    pyLibEditor = CodeMirror(document.getElementById(\"py-lib-code-editor-div\"), {\n        value: pyLibStarterCode,\n        mode: \"python\",\n        theme: \"eclipse\",\n        lineNumbers: true,\n        indentUnit: 4,\n        autoCloseBrackets: true\n    });\n\n    function pyLibResetCode() {\n        pyLibEditor.setValue(pyLibStarterCode);\n        document.getElementById(\"py-lib-output-console\").innerText = \"Run code to see output...\";\n    }\n\n    function pyLibRunCode() {\n        const spinner   = document.getElementById('py-lib-btn-spinner');\n        const btnText   = document.getElementById('py-lib-btn-text');\n        const outputBox = document.getElementById('py-lib-output-console');\n        spinner.style.display = \"inline-block\";\n        btnText.innerText = \"Running \";\n        outputBox.innerText = \"Processing...\";\n        outputBox.style.color = \"#6b7280\";\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: pyLibEditor.getValue(), input: \"\" }),\n        })\n        .then(r => r.json())\n        .then(data => {\n            if (data.output) { outputBox.innerText = data.output; outputBox.style.color = \"#1f2937\"; }\n            else if (data.error || data.errors) { outputBox.innerText = data.error || data.errors; outputBox.style.color = \"#ef4444\"; }\n            else { outputBox.innerText = \"No output returned.\"; }\n        })\n        .catch(err => { outputBox.innerText = \"Error: \" + err.message; outputBox.style.color = \"#ef4444\"; })\n        .finally(() => { spinner.style.display = \"none\"; btnText.innerText = \"Run Code\"; });\n    }\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>&larr; Previous Module 9: Inheritance &amp; Polymorphism Next &rarr; Statement Solution Python Exercise 9.2: Library Management Put your OOP skills to work on a real-world system. Build a mini library that tracks books, members, and borrowing \u2014 using multiple classes that interact with each other. Define three classes: Book \u2014 stores title, author, and an [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":0,"parent":114145,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","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-117691","page","type-page","status-publish","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 Program Library Management System - Great Learning Blog: Free Resources what Matters to shape your Career!<\/title>\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\/python-program-library-management-system\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Program Library Management System\" \/>\n<meta property=\"og:description\" content=\"&larr; Previous Module 9: Inheritance &amp; Polymorphism Next &rarr; Statement Solution Python Exercise 9.2: Library Management Put your OOP skills to work on a real-world system. Build a mini library that tracks books, members, and borrowing \u2014 using multiple classes that interact with each other. Define three classes: Book \u2014 stores title, author, and an [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/python-program-library-management-system\/\" \/>\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 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\\\/python-program-library-management-system\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/python-exercise\\\/python-program-library-management-system\\\/\"},\"author\":{\"name\":\"Great Learning Editorial Team\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\"},\"headline\":\"Python Program Library Management System\",\"datePublished\":\"2026-05-12T11:16:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/python-exercise\\\/python-program-library-management-system\\\/\"},\"wordCount\":524,\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"keywords\":[\"python\",\"python-exercise\"],\"articleSection\":[\"IT\\\/Software Development\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/python-exercise\\\/python-program-library-management-system\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/python-exercise\\\/python-program-library-management-system\\\/\",\"name\":\"Python Program Library Management System - Great Learning Blog: Free Resources what Matters to shape your Career!\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\"},\"datePublished\":\"2026-05-12T11:16:42+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/python-exercise\\\/python-program-library-management-system\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/python-exercise\\\/python-program-library-management-system\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/python-exercise\\\/python-program-library-management-system\\\/#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 Program Library Management System\"}]},{\"@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 Program Library Management System - Great Learning Blog: Free Resources what Matters to shape your Career!","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\/python-program-library-management-system\/","og_locale":"en_US","og_type":"article","og_title":"Python Program Library Management System","og_description":"&larr; Previous Module 9: Inheritance &amp; Polymorphism Next &rarr; Statement Solution Python Exercise 9.2: Library Management Put your OOP skills to work on a real-world system. Build a mini library that tracks books, members, and borrowing \u2014 using multiple classes that interact with each other. Define three classes: Book \u2014 stores title, author, and an [&hellip;]","og_url":"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/python-program-library-management-system\/","og_site_name":"Great Learning Blog: Free Resources what Matters to shape your Career!","article_publisher":"https:\/\/www.facebook.com\/GreatLearningOfficial\/","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\/python-program-library-management-system\/#article","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/python-program-library-management-system\/"},"author":{"name":"Great Learning Editorial Team","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad"},"headline":"Python Program Library Management System","datePublished":"2026-05-12T11:16:42+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/python-program-library-management-system\/"},"wordCount":524,"publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"keywords":["python","python-exercise"],"articleSection":["IT\/Software Development"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/python-program-library-management-system\/","url":"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/python-program-library-management-system\/","name":"Python Program Library Management System - Great Learning Blog: Free Resources what Matters to shape your Career!","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#website"},"datePublished":"2026-05-12T11:16:42+00:00","breadcrumb":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/python-program-library-management-system\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/python-program-library-management-system\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/python-program-library-management-system\/#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 Program Library Management System"}]},{"@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":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"web-stories-poster-portrait":false,"web-stories-publisher-logo":false,"web-stories-thumbnail":false},"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 9: Inheritance &amp; Polymorphism Next &rarr; Statement Solution Python Exercise 9.2: Library Management Put your OOP skills to work on a real-world system. Build a mini library that tracks books, members, and borrowing \u2014 using multiple classes that interact with each other. Define three classes: Book \u2014 stores title, author, and an&hellip;","_links":{"self":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/pages\/117691","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=117691"}],"version-history":[{"count":3,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/pages\/117691\/revisions"}],"predecessor-version":[{"id":117889,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/pages\/117691\/revisions\/117889"}],"up":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/pages\/114145"}],"wp:attachment":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media?parent=117691"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/categories?post=117691"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/tags?post=117691"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}