{"id":117690,"date":"2026-05-12T16:46:46","date_gmt":"2026-05-12T11:16:46","guid":{"rendered":"https:\/\/www.mygreatlearning.com\/blog\/?page_id=117690"},"modified":"2026-05-12T16:35:42","modified_gmt":"2026-05-12T11:05:42","slug":"python-program-employee-system-implementation","status":"publish","type":"page","link":"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/python-program-employee-system-implementation\/","title":{"rendered":"Python Program Employee System Implementation"},"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    .py-emp-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-emp-wrapper * { box-sizing: border-box; }\n    .py-emp-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-emp-nav-title { font-weight: 600; color: var(--py-text-secondary); font-size: 14px; }\n    .py-emp-ide-container { display: flex; flex: 1; height: auto; min-width: 100%; background: white; overflow: hidden; }\n    .py-emp-left-pane { width: 45%; border-right: 1px solid var(--py-border); background: var(--py-bg-panel); display: flex; flex-direction: column; }\n    .py-emp-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-emp-tab-item { cursor: pointer; padding: 14px 0; border-bottom: 2px solid transparent; }\n    .py-emp-tab-item.active { color: var(--py-text-primary); border-bottom-color: var(--py-primary-blue); }\n    .py-emp-tab-item:hover { color: var(--py-text-primary); }\n    .py-emp-pane-content { flex: 1; overflow-y: auto; padding: 25px; display: none; }\n    .py-emp-pane-content.active { display: block; }\n    .py-emp-wrapper h1 { margin-top: 0; font-size: 22px; font-weight: 600; color: var(--py-text-primary); margin-bottom: 1rem; }\n    .py-emp-wrapper p { line-height: 1.6; color: #374151; margin-bottom: 1rem; }\n    .py-emp-wrapper ul { margin-bottom: 20px; color: #374151; line-height: 1.6; padding-left: 20px; }\n    .py-emp-wrapper li { margin-bottom: 5px; }\n    .py-emp-wrapper h3 { font-size: 16px; margin-top: 15px; margin-bottom: 10px; }\n    .py-emp-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-emp-sample-box { background-color: #f3f4f6; border: 1px solid var(--py-border); border-radius: 6px; margin-top: 20px; overflow: hidden; }\n    .py-emp-sample-header { display: flex; background-color: #e5e7eb; font-size: 13px; font-weight: 600; color: var(--py-text-primary); }\n    .py-emp-sample-col-title { width: 50%; padding: 8px 15px; border-right: 1px solid #d1d5db; }\n    .py-emp-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-emp-sample-body { display: flex; }\n    .py-emp-right-pane { width: 55%; display: flex; flex-direction: column; background: var(--py-bg-panel); }\n    .py-emp-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-emp-lang-label { font-weight: 600; font-size: 14px; background: #e5e7eb; padding: 4px 12px; border-radius: 4px; }\n    .py-emp-editor-settings i { color: var(--py-text-secondary); margin-left: 15px; cursor: pointer; font-size: 16px; }\n    .py-emp-code-area { flex: 1; display: flex; flex-direction: column; position: relative; }\n    .py-emp-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-emp-console-section { border-top: 1px solid var(--py-border); background: #f9fafb; display: flex; flex-direction: column; height: 35%; }\n    .py-emp-console-header { padding: 8px 15px; background: #e5e7eb; font-size: 12px; font-weight: 600; color: var(--py-text-secondary); text-transform: uppercase; }\n    .py-emp-console-body { display: flex; flex: 1; overflow: hidden; }\n    .py-emp-input-wrapper, .py-emp-output-wrapper { flex: 1; display: flex; flex-direction: column; padding: 10px; border-right: 1px solid var(--py-border); }\n    .py-emp-output-wrapper { border-right: none; }\n    .py-emp-console-label { font-size: 12px; font-weight: 600; margin-bottom: 5px; color: var(--py-text-secondary); }\n    textarea.py-emp-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-emp-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-emp-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-emp-execution-group { display: flex; gap: 12px; align-items: center; }\n    .py-emp-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-emp-btn-secondary { background: transparent; border: 1px solid var(--py-border); color: var(--py-text-primary); }\n    .py-emp-btn-secondary:hover { background: #f3f4f6; }\n    .py-emp-btn-primary { background: var(--py-primary-blue); border: 1px solid var(--py-primary-blue); color: white; }\n    .py-emp-btn-primary:hover { background: var(--py-primary-hover); }\n    .py-emp-spinner { display: none; width: 14px; height: 14px; border: 2px solid #fff; border-top-color: transparent; border-radius: 50%; animation: py-emp-spin 0.8s linear infinite; margin-left: 8px; }\n    @keyframes py-emp-spin { 100% { transform: rotate(360deg); } }\n    .py-emp-hidden { display: none !important; }\n    .py-emp-btn-mobile { display: none !important; }\n    @media (max-width: 768px) {\n        .py-emp-wrapper { display: block; height: auto; min-height: auto; }\n        .py-emp-ide-container { flex: none; height: auto; }\n        .py-emp-top-nav { display: none; }\n        .py-emp-ide-container { flex-direction: column; overflow-y: auto; height: auto; }\n        .py-emp-left-pane, .py-emp-right-pane { width: 100%; height: auto; }\n        .py-emp-left-pane { border-right: none; border-bottom: 8px solid #f3f4f6; min-height: auto; max-height: 400px; }\n        .py-emp-right-pane { display: flex; flex-direction: column; }\n        .py-emp-console-section, .py-emp-console-body, .py-emp-footer-actions { display: contents; }\n        .py-emp-console-header { display: none; }\n        .py-emp-editor-top-bar { order: 1; }\n        .py-emp-code-area { order: 2; height: 500px; flex: none; }\n        .py-emp-code-area .CodeMirror { position: relative; height: 500px; }\n        .py-emp-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-emp-execution-group { order: 4; width: 100%; display: flex; padding: 15px; gap: 10px; border-bottom: 1px solid var(--py-border); background: #fff; }\n        .py-emp-execution-group .py-emp-btn { flex: 1; }\n        .py-emp-output-wrapper { order: 5; width: 100%; height: auto; min-height: 300px; max-height: 500px; border-right: none; background: #fff; }\n        .py-emp-btn-mobile { display: inline-flex !important; order: 6; width: 48%; margin: 15px 1%; box-sizing: border-box; text-align: center; }\n        a.py-emp-hidden { display: none !important; }\n    }\n<\/style>\n\n<div class=\"py-emp-wrapper\">\n    <div class=\"py-emp-top-nav\">\n        <a id=\"py-emp-btn-prev-top\" class=\"py-emp-btn py-emp-btn-secondary py-emp-hidden\" href=\"#\">&larr; Previous<\/a>\n        <span class=\"py-emp-nav-title\">Module 9: Inheritance &amp; Polymorphism<\/span>\n        <a id=\"py-emp-btn-next-top\" class=\"py-emp-btn py-emp-btn-primary py-emp-hidden\" href=\"#\">Next &rarr;<\/a>\n    <\/div>\n\n    <div class=\"py-emp-ide-container\" id=\"py-emp-ideContainer\">\n\n        <div class=\"py-emp-left-pane\">\n            <div class=\"py-emp-tabs-header\">\n                <div class=\"py-emp-tab-item active\" onclick=\"pyEmpSwitchTab('statement')\">Statement<\/div>\n                <div class=\"py-emp-tab-item\" onclick=\"pyEmpSwitchTab('solution')\">Solution<\/div>\n            <\/div>\n\n            <div id=\"py-emp-tab-statement\" class=\"py-emp-pane-content active\">\n                <h1 id=\"python-exercise-9-1-employee-system\">Python Exercise 9.1: Employee System<\/h1>\n                <p>Inheritance lets a child class reuse and extend the behaviour of a parent class. Build an <code>Employee<\/code> base class and a <code>Manager<\/code> subclass that overrides the pay calculation to include a bonus.<\/p>\n\n                <p>Your program should:<\/p>\n                <ul>\n                    <li>Define a base class <code>Employee<\/code> with an <code>__init__<\/code> that stores <code>name<\/code> and <code>base_salary<\/code>.<\/li>\n                    <li>Add a <code>calculate_pay()<\/code> method to <code>Employee<\/code> that returns <code>base_salary<\/code>.<\/li>\n                    <li>Add a <code>__str__<\/code> method to <code>Employee<\/code> that returns a string like <code>Employee: Alice | Pay: $3000<\/code>.<\/li>\n                    <li>Define a subclass <code>Manager<\/code> that inherits from <code>Employee<\/code>.<\/li>\n                    <li><code>Manager.__init__<\/code> should accept an additional <code>bonus<\/code> parameter and call <code>super()<\/code> to initialise the parent.<\/li>\n                    <li>Override <code>calculate_pay()<\/code> in <code>Manager<\/code> to return <code>base_salary + bonus<\/code>.<\/li>\n                    <li>Override <code>__str__<\/code> in <code>Manager<\/code> to return a string like <code>Manager: Bob | Pay: $5500<\/code>.<\/li>\n                    <li>Create one <code>Employee<\/code> and one <code>Manager<\/code> instance and print both.<\/li>\n                <\/ul>\n\n                <h3 id=\"sample-interaction\">Sample Interaction:<\/h3>\n                <div class=\"py-emp-sample-box\">\n                    <div class=\"py-emp-sample-header\">\n                        <div class=\"py-emp-sample-col-title\">Input<\/div>\n                        <div class=\"py-emp-sample-col-title\">Output<\/div>\n                    <\/div>\n                    <div class=\"py-emp-sample-body\">\n                        <div class=\"py-emp-sample-col-content\">(None)<\/div>\n                        <div class=\"py-emp-sample-col-content\">Employee: Alice | Pay: $3000\nManager: Bob | Pay: $5500<\/div>\n                    <\/div>\n                <\/div>\n            <\/div>\n\n            <div id=\"py-emp-tab-solution\" class=\"py-emp-pane-content\">\n                <h1 id=\"solution\">Solution<\/h1>\n                <p><code>Manager<\/code> inherits everything from <code>Employee<\/code> and only overrides the methods that differ, keeping the code clean and DRY.<\/p>\n                <div class=\"py-emp-solution-block\">class Employee:\n    def __init__(self, name, base_salary):\n        self.name = name\n        self.base_salary = base_salary\n\n    def calculate_pay(self):\n        return self.base_salary\n\n    def __str__(self):\n        return f\"Employee: {self.name} | Pay: ${self.calculate_pay()}\"\n\n\nclass Manager(Employee):\n    def __init__(self, name, base_salary, bonus):\n        super().__init__(name, base_salary)\n        self.bonus = bonus\n\n    def calculate_pay(self):\n        return self.base_salary + self.bonus\n\n    def __str__(self):\n        return f\"Manager: {self.name} | Pay: ${self.calculate_pay()}\"\n\n\n# Create instances\nemp = Employee(\"Alice\", 3000)\nmgr = Manager(\"Bob\", 4000, 1500)\n\nprint(emp)\nprint(mgr)<\/div>\n\n                <p style=\"margin-top:20px\"><strong>Key Concepts:<\/strong><\/p>\n                <ul>\n                    <li><code>class Child(Parent):<\/code> syntax creates a subclass that inherits all parent attributes and methods.<\/li>\n                    <li><code>super().__init__(...)<\/code> calls the parent constructor, avoiding code duplication.<\/li>\n                    <li><strong>Method overriding<\/strong> \u2014 defining a method in the child with the same name replaces the parent's version.<\/li>\n                    <li><strong>Polymorphism<\/strong> \u2014 <code>print(emp)<\/code> and <code>print(mgr)<\/code> call the same <code>__str__<\/code> name but produce different results based on the object's actual type.<\/li>\n                    <li><code>__str__<\/code> is a dunder (magic) method Python calls automatically when you use <code>print()<\/code> or <code>str()<\/code> on an object.<\/li>\n                <\/ul>\n            <\/div>\n        <\/div>\n\n        <div class=\"py-emp-right-pane\">\n            <div class=\"py-emp-editor-top-bar\">\n                <span class=\"py-emp-lang-label\">Python 3<\/span>\n                <div class=\"py-emp-editor-settings\">\n                    <i class=\"fas fa-expand\" id=\"py-emp-fullscreenBtn\" title=\"Toggle Fullscreen\"><\/i>\n                <\/div>\n            <\/div>\n            <div class=\"py-emp-code-area\">\n                <div id=\"py-emp-code-editor-div\"><\/div>\n            <\/div>\n            <div class=\"py-emp-console-section\">\n                <div class=\"py-emp-console-header\">Test Console<\/div>\n                <div class=\"py-emp-console-body\">\n                    <div class=\"py-emp-input-wrapper\">\n                        <label class=\"py-emp-console-label\">Custom Input (Stdin)<\/label>\n                        <textarea id=\"py-emp-custom-input\" class=\"py-emp-custom-input-area\" placeholder=\"No input needed...\" disabled style=\"background: #f3f4f6; color: #9ca3af;\"><\/textarea>\n                    <\/div>\n                    <div class=\"py-emp-output-wrapper\">\n                        <label class=\"py-emp-console-label\">Output<\/label>\n                        <div id=\"py-emp-output-console\" class=\"py-emp-output-display\">Run code to see output...<\/div>\n                    <\/div>\n                <\/div>\n            <\/div>\n            <div class=\"py-emp-footer-actions\">\n                <a id=\"py-emp-btn-prev-mobile\" class=\"py-emp-btn py-emp-btn-secondary py-emp-hidden py-emp-btn-mobile\" href=\"#\">&larr; Previous<\/a>\n                <div class=\"py-emp-execution-group\">\n                    <button class=\"py-emp-btn py-emp-btn-secondary\" onclick=\"pyEmpResetCode()\">Reset<\/button>\n                    <button class=\"py-emp-btn py-emp-btn-primary\" onclick=\"pyEmpRunCode()\">\n                        <span id=\"py-emp-btn-text\">Run Code<\/span>\n                        <span class=\"py-emp-spinner\" id=\"py-emp-btn-spinner\"><\/span>\n                    <\/button>\n                <\/div>\n                <a id=\"py-emp-btn-next-mobile\" class=\"py-emp-btn py-emp-btn-primary py-emp-hidden py-emp-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 pyEmpEditor;\n    var pyEmpStarterCode;\n\n    const pyEmpPrevLink = \"\";\n    const pyEmpNextLink = \"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/python-program-library-management-system\";\n\n    document.addEventListener(\"DOMContentLoaded\", function() {\n        const prevBtnTop    = document.getElementById('py-emp-btn-prev-top');\n        const nextBtnTop    = document.getElementById('py-emp-btn-next-top');\n        const prevBtnMobile = document.getElementById('py-emp-btn-prev-mobile');\n        const nextBtnMobile = document.getElementById('py-emp-btn-next-mobile');\n        if (pyEmpPrevLink && pyEmpPrevLink.trim() !== \"\") {\n            prevBtnTop.href = pyEmpPrevLink; prevBtnMobile.href = pyEmpPrevLink;\n            prevBtnTop.classList.remove('py-emp-hidden'); prevBtnMobile.classList.remove('py-emp-hidden');\n        }\n        if (pyEmpNextLink && pyEmpNextLink.trim() !== \"\") {\n            nextBtnTop.href = pyEmpNextLink; nextBtnMobile.href = pyEmpNextLink;\n            nextBtnTop.classList.remove('py-emp-hidden'); nextBtnMobile.classList.remove('py-emp-hidden');\n        }\n    });\n\n    function pyEmpSwitchTab(tabName) {\n        document.querySelectorAll('#py-emp-tab-statement, #py-emp-tab-solution').forEach(el => el.classList.remove('active'));\n        const headerTabs = document.querySelector('#py-emp-ideContainer .py-emp-tabs-header').children;\n        Array.from(headerTabs).forEach(el => el.classList.remove('active'));\n        document.getElementById('py-emp-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 pyEmpFullscreenBtn = document.getElementById('py-emp-fullscreenBtn');\n    const pyEmpIdeContainer  = document.getElementById('py-emp-ideContainer');\n    if (pyEmpFullscreenBtn) {\n        pyEmpFullscreenBtn.addEventListener('click', () => {\n            if (!document.fullscreenElement) {\n                pyEmpIdeContainer.requestFullscreen().catch(err => alert(`Error: ${err.message}`));\n                pyEmpFullscreenBtn.classList.replace('fa-expand', 'fa-compress');\n            } else {\n                document.exitFullscreen();\n                pyEmpFullscreenBtn.classList.replace('fa-compress', 'fa-expand');\n            }\n        });\n    }\n\n    pyEmpStarterCode = `# Exercise 9.1: Employee System\n# Subclass Manager from Employee and override calculate_pay to add a bonus\n\n# 1. Define the base Employee class\n# class Employee:\n\n    # Constructor: store name and base_salary\n    # def __init__(self, name, base_salary):\n    #     ...\n\n    # Return base_salary as the pay\n    # def calculate_pay(self):\n    #     ...\n\n    # String representation: \"Employee: Alice | Pay: $3000\"\n    # def __str__(self):\n    #     ...\n\n\n# 2. Define the Manager subclass (inherits from Employee)\n# class Manager(Employee):\n\n    # Constructor: also accepts a bonus; call super().__init__()\n    # def __init__(self, name, base_salary, bonus):\n    #     super().__init__(...)\n    #     self.bonus = ...\n\n    # Override calculate_pay to return base_salary + bonus\n    # def calculate_pay(self):\n    #     ...\n\n    # Override __str__: \"Manager: Bob | Pay: $5500\"\n    # def __str__(self):\n    #     ...\n\n\n# 3. Create instances and print them\n# emp = Employee(\"Alice\", 3000)\n# mgr = Manager(\"Bob\", 4000, 1500)\n# print(emp)\n# print(mgr)\n`;\n\n    pyEmpEditor = CodeMirror(document.getElementById(\"py-emp-code-editor-div\"), {\n        value: pyEmpStarterCode,\n        mode: \"python\",\n        theme: \"eclipse\",\n        lineNumbers: true,\n        indentUnit: 4,\n        autoCloseBrackets: true\n    });\n\n    function pyEmpResetCode() {\n        pyEmpEditor.setValue(pyEmpStarterCode);\n        document.getElementById(\"py-emp-output-console\").innerText = \"Run code to see output...\";\n    }\n\n    function pyEmpRunCode() {\n        const spinner   = document.getElementById('py-emp-btn-spinner');\n        const btnText   = document.getElementById('py-emp-btn-text');\n        const outputBox = document.getElementById('py-emp-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: pyEmpEditor.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.1: Employee System Inheritance lets a child class reuse and extend the behaviour of a parent class. Build an Employee base class and a Manager subclass that overrides the pay calculation to include a bonus. Your program should: Define a base class [&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-117690","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 Employee System Implementation - 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-employee-system-implementation\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Program Employee System Implementation\" \/>\n<meta property=\"og:description\" content=\"&larr; Previous Module 9: Inheritance &amp; Polymorphism Next &rarr; Statement Solution Python Exercise 9.1: Employee System Inheritance lets a child class reuse and extend the behaviour of a parent class. Build an Employee base class and a Manager subclass that overrides the pay calculation to include a bonus. Your program should: Define a base class [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/python-program-employee-system-implementation\/\" \/>\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-employee-system-implementation\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/python-exercise\\\/python-program-employee-system-implementation\\\/\"},\"author\":{\"name\":\"Great Learning Editorial Team\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\"},\"headline\":\"Python Program Employee System Implementation\",\"datePublished\":\"2026-05-12T11:16:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/python-exercise\\\/python-program-employee-system-implementation\\\/\"},\"wordCount\":316,\"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-employee-system-implementation\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/python-exercise\\\/python-program-employee-system-implementation\\\/\",\"name\":\"Python Program Employee System Implementation - Great Learning Blog: Free Resources what Matters to shape your Career!\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\"},\"datePublished\":\"2026-05-12T11:16:46+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/python-exercise\\\/python-program-employee-system-implementation\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/python-exercise\\\/python-program-employee-system-implementation\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/python-exercise\\\/python-program-employee-system-implementation\\\/#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 Employee System Implementation\"}]},{\"@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 Employee System Implementation - 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-employee-system-implementation\/","og_locale":"en_US","og_type":"article","og_title":"Python Program Employee System Implementation","og_description":"&larr; Previous Module 9: Inheritance &amp; Polymorphism Next &rarr; Statement Solution Python Exercise 9.1: Employee System Inheritance lets a child class reuse and extend the behaviour of a parent class. Build an Employee base class and a Manager subclass that overrides the pay calculation to include a bonus. Your program should: Define a base class [&hellip;]","og_url":"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/python-program-employee-system-implementation\/","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-employee-system-implementation\/#article","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/python-program-employee-system-implementation\/"},"author":{"name":"Great Learning Editorial Team","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad"},"headline":"Python Program Employee System Implementation","datePublished":"2026-05-12T11:16:46+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/python-program-employee-system-implementation\/"},"wordCount":316,"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-employee-system-implementation\/","url":"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/python-program-employee-system-implementation\/","name":"Python Program Employee System Implementation - Great Learning Blog: Free Resources what Matters to shape your Career!","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#website"},"datePublished":"2026-05-12T11:16:46+00:00","breadcrumb":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/python-program-employee-system-implementation\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/python-program-employee-system-implementation\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.mygreatlearning.com\/blog\/python-exercise\/python-program-employee-system-implementation\/#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 Employee System Implementation"}]},{"@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.1: Employee System Inheritance lets a child class reuse and extend the behaviour of a parent class. Build an Employee base class and a Manager subclass that overrides the pay calculation to include a bonus. Your program should: Define a base class&hellip;","_links":{"self":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/pages\/117690","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=117690"}],"version-history":[{"count":2,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/pages\/117690\/revisions"}],"predecessor-version":[{"id":117695,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/pages\/117690\/revisions\/117695"}],"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=117690"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/categories?post=117690"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/tags?post=117690"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}