{"id":2095,"date":"2024-12-05T11:37:33","date_gmt":"2024-12-05T09:37:33","guid":{"rendered":"https:\/\/epicmarketing.co.il\/notebook\/?p=2095"},"modified":"2024-12-05T11:39:36","modified_gmt":"2024-12-05T09:39:36","slug":"python-object-oriented-programming","status":"publish","type":"post","link":"https:\/\/epicmarketing.co.il\/notebook\/python-object-oriented-programming\/","title":{"rendered":"\u05ea\u05db\u05e0\u05d5\u05ea \u05de\u05d5\u05e0\u05d7\u05d4 \u05e2\u05e6\u05de\u05d9\u05dd (Object-Oriented Programming &#8211; OOP)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u05ea\u05db\u05e0\u05d5\u05ea \u05de\u05d5\u05e0\u05d7\u05d4 \u05e2\u05e6\u05de\u05d9\u05dd (OOP) \u05d4\u05d5\u05d0 \u05e1\u05d2\u05e0\u05d5\u05df \u05ea\u05db\u05e0\u05d5\u05ea \u05d4\u05de\u05d0\u05e4\u05e9\u05e8 \u05e2\u05d1\u05d5\u05d3\u05d4 \u05e2\u05dd <strong>\u05de\u05d7\u05dc\u05e7\u05d5\u05ea (Classes)<\/strong> \u05d5-<strong>\u05d0\u05d5\u05d1\u05d9\u05d9\u05e7\u05d8\u05d9\u05dd (Objects)<\/strong> \u05db\u05d3\u05d9 \u05dc\u05d0\u05e8\u05d2\u05df \u05e7\u05d5\u05d3 \u05d1\u05e6\u05d5\u05e8\u05d4 \u05d9\u05e2\u05d9\u05dc\u05d4 \u05d5\u05e0\u05d9\u05ea\u05e0\u05ea \u05dc\u05e9\u05d9\u05de\u05d5\u05e9 \u05d7\u05d5\u05d6\u05e8.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u05de\u05d5\u05e9\u05d2\u05d9\u05dd \u05de\u05e8\u05db\u05d6\u05d9\u05d9\u05dd:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u05de\u05d7\u05dc\u05e7\u05d5\u05ea \u05d5\u05d0\u05d5\u05d1\u05d9\u05d9\u05e7\u05d8\u05d9\u05dd:<\/strong><br>\u05de\u05d7\u05dc\u05e7\u05d4 \u05d4\u05d9\u05d0 \u05ea\u05d1\u05e0\u05d9\u05ea (Template) \u05dc\u05d9\u05e6\u05d9\u05e8\u05ea \u05d0\u05d5\u05d1\u05d9\u05d9\u05e7\u05d8\u05d9\u05dd. \u05d0\u05d5\u05d1\u05d9\u05d9\u05e7\u05d8 \u05d4\u05d5\u05d0 \u05de\u05d5\u05e4\u05e2 (Instance) \u05e9\u05dc \u05de\u05d7\u05dc\u05e7\u05d4.<\/li>\n\n\n\n<li><strong>\u05d9\u05e8\u05d5\u05e9\u05d4 (Inheritance):<\/strong><br>\u05de\u05d0\u05e4\u05e9\u05e8\u05ea \u05dc\u05de\u05d7\u05dc\u05e7\u05d4 \u05d0\u05d7\u05ea \u05dc\u05e8\u05e9\u05ea \u05ea\u05db\u05d5\u05e0\u05d5\u05ea (Attributes) \u05d5\u05e9\u05d9\u05d8\u05d5\u05ea (Methods) \u05de\u05de\u05d7\u05dc\u05e7\u05d4 \u05d0\u05d7\u05e8\u05ea.<\/li>\n\n\n\n<li><strong>\u05e4\u05d5\u05dc\u05d9\u05de\u05d5\u05e8\u05e4\u05d9\u05d6\u05dd (Polymorphism):<\/strong><br>\u05de\u05d0\u05e4\u05e9\u05e8 \u05dc\u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d5\u05ea \u05d0\u05d5 \u05e9\u05d9\u05d8\u05d5\u05ea \u05dc\u05e4\u05e2\u05d5\u05dc \u05d1\u05d0\u05d5\u05e4\u05df \u05e9\u05d5\u05e0\u05d4 \u05e2\u05dc \u05e1\u05de\u05da \u05e1\u05d5\u05d2 \u05d4\u05d0\u05d5\u05d1\u05d9\u05d9\u05e7\u05d8.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">\u05de\u05d7\u05dc\u05e7\u05d5\u05ea \u05d5\u05d0\u05d5\u05d1\u05d9\u05d9\u05e7\u05d8\u05d9\u05dd<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u05d3\u05d5\u05d2\u05de\u05ea \u05e7\u05d5\u05d3: \u05e0\u05d9\u05d4\u05d5\u05dc \u05e2\u05d5\u05d1\u05d3\u05d9\u05dd<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nclass Employee:\n    &quot;&quot;&quot;A class to represent an employee.&quot;&quot;&quot;\n    def __init__(self, name, position, salary):\n        self.name = name  # Employee&#039;s name\n        self.position = position  # Employee&#039;s position\n        self.salary = salary  # Employee&#039;s salary\n\n    def describe(self):\n        &quot;&quot;&quot;Print details about the employee.&quot;&quot;&quot;\n        print(f&quot;Name: {self.name}, Position: {self.position}, Salary: ${self.salary}&quot;)\n\n    def give_raise(self, amount):\n        &quot;&quot;&quot;Increase the employee&#039;s salary.&quot;&quot;&quot;\n        self.salary += amount\n        print(f&quot;{self.name} received a raise of ${amount}. New salary is ${self.salary}&quot;)\n\n# Creating and using objects\nemployee1 = Employee(&quot;Alice&quot;, &quot;Developer&quot;, 60000)\nemployee2 = Employee(&quot;Bob&quot;, &quot;Designer&quot;, 55000)\n\nemployee1.describe()  # Outputs: Name: Alice, Position: Developer, Salary: $60000\nemployee2.give_raise(5000)  # Outputs: Bob received a raise of $5000. New salary is $60000\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\"><strong>\u05d4\u05e1\u05d1\u05e8 \u05e2\u05dc \u05d4\u05e7\u05d5\u05d3<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u05de\u05d7\u05dc\u05e7\u05d4 <code>Employee<\/code>:<\/strong>\n<ul class=\"wp-block-list\">\n<li><code>__init__<\/code>: \u05e7\u05d5\u05e0\u05e1\u05d8\u05e8\u05e7\u05d8\u05d5\u05e8 \u05e9\u05de\u05d2\u05d3\u05d9\u05e8 \u05e9\u05dd, \u05ea\u05e4\u05e7\u05d9\u05d3 \u05d5\u05de\u05e9\u05db\u05d5\u05e8\u05ea.<\/li>\n\n\n\n<li><code>describe<\/code>: \u05e9\u05d9\u05d8\u05d4 \u05e9\u05de\u05d3\u05e4\u05d9\u05e1\u05d4 \u05de\u05d9\u05d3\u05e2 \u05e2\u05dc \u05d4\u05e2\u05d5\u05d1\u05d3.<\/li>\n\n\n\n<li><code>give_raise<\/code>: \u05e9\u05d9\u05d8\u05d4 \u05e9\u05de\u05e2\u05dc\u05d4 \u05d0\u05ea \u05d4\u05de\u05e9\u05db\u05d5\u05e8\u05ea \u05e9\u05dc \u05d4\u05e2\u05d5\u05d1\u05d3 \u05d1\u05e1\u05db\u05d5\u05dd \u05e0\u05ea\u05d5\u05df.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u05d9\u05e6\u05d9\u05e8\u05ea \u05d0\u05d5\u05d1\u05d9\u05d9\u05e7\u05d8\u05d9\u05dd:<\/strong>\n<ul class=\"wp-block-list\">\n<li><code>employee1<\/code> \u05d5-<code>employee2<\/code> \u05d4\u05dd \u05d0\u05d5\u05d1\u05d9\u05d9\u05e7\u05d8\u05d9\u05dd \u05e0\u05e4\u05e8\u05d3\u05d9\u05dd \u05e9\u05dc \u05d4\u05de\u05d7\u05dc\u05e7\u05d4 <code>Employee<\/code>.<\/li>\n\n\n\n<li>\u05dc\u05db\u05dc \u05d0\u05d5\u05d1\u05d9\u05d9\u05e7\u05d8 \u05e0\u05ea\u05d5\u05e0\u05d9\u05dd \u05de\u05e9\u05dc\u05d5 \u05d5\u05e9\u05d9\u05d8\u05d5\u05ea \u05e9\u05e0\u05d9\u05ea\u05df \u05dc\u05e7\u05e8\u05d5\u05d0 \u05dc\u05d4\u05df.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">\u05d9\u05e8\u05d5\u05e9\u05d4<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u05d3\u05d5\u05d2\u05de\u05ea \u05e7\u05d5\u05d3: \u05de\u05d7\u05dc\u05e7\u05ea \u05e2\u05d5\u05d1\u05d3\u05d9\u05dd \u05d5\u05de\u05e0\u05d4\u05dc\u05d9\u05dd<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nclass Employee:\n    &quot;&quot;&quot;A base class to represent an employee.&quot;&quot;&quot;\n    def __init__(self, name, position, salary):\n        self.name = name\n        self.position = position\n        self.salary = salary\n\n    def describe(self):\n        &quot;&quot;&quot;Print details about the employee.&quot;&quot;&quot;\n        print(f&quot;Name: {self.name}, Position: {self.position}, Salary: ${self.salary}&quot;)\n\n# Inheriting from Employee\nclass Manager(Employee):\n    &quot;&quot;&quot;A class to represent a manager.&quot;&quot;&quot;\n    def __init__(self, name, position, salary, team_size):\n        super().__init__(name, position, salary)  # Inherit attributes from Employee\n        self.team_size = team_size  # Additional attribute for managers\n\n    def describe(self):\n        &quot;&quot;&quot;Print details about the manager.&quot;&quot;&quot;\n        super().describe()  # Call the describe method from Employee\n        print(f&quot;Team size: {self.team_size}&quot;)\n\n# Creating and using objects\nmanager = Manager(&quot;Charlie&quot;, &quot;Team Lead&quot;, 80000, 10)\nmanager.describe()\n# Outputs:\n# Name: Charlie, Position: Team Lead, Salary: $80000\n# Team size: 10\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\"><strong>\u05d4\u05e1\u05d1\u05e8 \u05e2\u05dc \u05d4\u05e7\u05d5\u05d3<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u05de\u05d7\u05dc\u05e7\u05d4 <code>Manager<\/code>:<\/strong>\n<ul class=\"wp-block-list\">\n<li>\u05d9\u05d5\u05e8\u05e9\u05ea \u05d0\u05ea <code>Employee<\/code> \u05d1\u05d0\u05de\u05e6\u05e2\u05d5\u05ea <code>class Manager(Employee)<\/code>.<\/li>\n\n\n\n<li>\u05d4\u05e7\u05d5\u05e0\u05e1\u05d8\u05e8\u05e7\u05d8\u05d5\u05e8 \u05de\u05e9\u05ea\u05de\u05e9 \u05d1-<code>super().__init__<\/code> \u05db\u05d3\u05d9 \u05dc\u05d4\u05d2\u05d3\u05d9\u05e8 \u05ea\u05db\u05d5\u05e0\u05d5\u05ea \u05de\u05d4\u05de\u05d7\u05dc\u05e7\u05d4 <code>Employee<\/code>.<\/li>\n\n\n\n<li>\u05de\u05d5\u05e1\u05d9\u05e4\u05d4 \u05ea\u05db\u05d5\u05e0\u05d4 \u05d7\u05d3\u05e9\u05d4 <code>team_size<\/code>.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u05e9\u05d9\u05d8\u05d4 <code>describe<\/code>:<\/strong>\n<ul class=\"wp-block-list\">\n<li><code>super().describe()<\/code>: \u05e7\u05d5\u05e8\u05d0\u05ea \u05dc\u05e9\u05d9\u05d8\u05d4 <code>describe<\/code> \u05e9\u05dc \u05d4\u05de\u05d7\u05dc\u05e7\u05d4 \u05d4\u05d0\u05d1 \u05db\u05d3\u05d9 \u05dc\u05d4\u05d3\u05e4\u05d9\u05e1 \u05d0\u05ea \u05e4\u05e8\u05d8\u05d9 \u05d4\u05e2\u05d5\u05d1\u05d3.<\/li>\n\n\n\n<li>\u05de\u05d5\u05e1\u05d9\u05e4\u05d4 \u05e4\u05e8\u05d8\u05d9\u05dd \u05e2\u05dc \u05de\u05e1\u05e4\u05e8 \u05d7\u05d1\u05e8\u05d9 \u05d4\u05e6\u05d5\u05d5\u05ea.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">\u05e4\u05d5\u05dc\u05d9\u05de\u05d5\u05e8\u05e4\u05d9\u05d6\u05dd<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u05d3\u05d5\u05d2\u05de\u05ea \u05e7\u05d5\u05d3: \u05de\u05e2\u05e8\u05db\u05ea \u05e9\u05db\u05e8<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nclass Employee:\n    &quot;&quot;&quot;A base class to represent an employee.&quot;&quot;&quot;\n    def __init__(self, name, salary):\n        self.name = name\n        self.salary = salary\n\n    def calculate_bonus(self):\n        &quot;&quot;&quot;Base bonus for employees.&quot;&quot;&quot;\n        return self.salary * 0.05\n\nclass Manager(Employee):\n    &quot;&quot;&quot;A class to represent a manager.&quot;&quot;&quot;\n    def calculate_bonus(self):\n        &quot;&quot;&quot;Bonus for managers.&quot;&quot;&quot;\n        return self.salary * 0.1\n\nclass Intern(Employee):\n    &quot;&quot;&quot;A class to represent an intern.&quot;&quot;&quot;\n    def calculate_bonus(self):\n        &quot;&quot;&quot;No bonus for interns.&quot;&quot;&quot;\n        return 0\n\n# Using polymorphism\nemployees = &#x5B;\n    Employee(&quot;Alice&quot;, 60000),\n    Manager(&quot;Bob&quot;, 80000),\n    Intern(&quot;Charlie&quot;, 20000)\n]\n\nfor employee in employees:\n    print(f&quot;{employee.name}&#039;s bonus: ${employee.calculate_bonus()}&quot;)\n# Outputs:\n# Alice&#039;s bonus: $3000.0\n# Bob&#039;s bonus: $8000.0\n# Charlie&#039;s bonus: $0\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\"><strong>\u05d4\u05e1\u05d1\u05e8 \u05e2\u05dc \u05d4\u05e7\u05d5\u05d3<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u05de\u05d7\u05dc\u05e7\u05d5\u05ea \u05e2\u05dd \u05e9\u05d9\u05d8\u05d5\u05ea \u05d6\u05d4\u05d5\u05ea:<\/strong>\n<ul class=\"wp-block-list\">\n<li><code>Employee<\/code>, <code>Manager<\/code>, \u05d5-<code>Intern<\/code> \u05db\u05d5\u05dc\u05df \u05de\u05db\u05d9\u05dc\u05d5\u05ea \u05d0\u05ea \u05d4\u05e9\u05d9\u05d8\u05d4 <code>calculate_bonus<\/code>, \u05d0\u05da \u05db\u05dc \u05d0\u05d7\u05ea \u05de\u05de\u05de\u05e9\u05ea \u05d0\u05d5\u05ea\u05d4 \u05d1\u05e6\u05d5\u05e8\u05d4 \u05e9\u05d5\u05e0\u05d4.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u05e4\u05d5\u05dc\u05d9\u05de\u05d5\u05e8\u05e4\u05d9\u05d6\u05dd:<\/strong>\n<ul class=\"wp-block-list\">\n<li>\u05d4\u05dc\u05d5\u05dc\u05d0\u05d4 <code>for employee in employees<\/code> \u05de\u05d0\u05e4\u05e9\u05e8\u05ea \u05dc\u05e7\u05e8\u05d5\u05d0 \u05dc\u05e9\u05d9\u05d8\u05d4 <code>calculate_bonus<\/code> \u05dc\u05db\u05dc \u05d0\u05d5\u05d1\u05d9\u05d9\u05e7\u05d8, \u05d5\u05d4\u05ea\u05d5\u05e6\u05d0\u05d4 \u05de\u05e9\u05ea\u05e0\u05d4 \u05d1\u05d4\u05ea\u05d0\u05dd \u05dc\u05de\u05d7\u05dc\u05e7\u05d4 \u05e9\u05dc \u05d4\u05d0\u05d5\u05d1\u05d9\u05d9\u05e7\u05d8.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">\u05ea\u05e8\u05d2\u05d9\u05dc\u05d9\u05dd<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u05ea\u05e8\u05d2\u05d9\u05dc 1:<\/strong><br>\u05e6\u05e8\u05d5 \u05de\u05d7\u05dc\u05e7\u05d4 <code>Product<\/code> \u05e2\u05dd \u05ea\u05db\u05d5\u05e0\u05d5\u05ea <code>name<\/code> \u05d5-<code>price<\/code>, \u05d5\u05e9\u05d9\u05d8\u05d4 \u05e9\u05de\u05d3\u05e4\u05d9\u05e1\u05d4 \u05d0\u05ea \u05d4\u05de\u05d5\u05e6\u05e8.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u05ea\u05e8\u05d2\u05d9\u05dc 2:<\/strong><br>\u05db\u05ea\u05d1\u05d5 \u05de\u05d7\u05dc\u05e7\u05d4 <code>DiscountedProduct<\/code> \u05e9\u05d9\u05d5\u05e8\u05e9\u05ea \u05de-<code>Product<\/code>, \u05d5\u05de\u05d5\u05e1\u05d9\u05e4\u05d4 \u05ea\u05db\u05d5\u05e0\u05d4 <code>discount<\/code>. \u05d4\u05d5\u05e1\u05d9\u05e4\u05d5 \u05e9\u05d9\u05d8\u05d4 \u05e9\u05de\u05d7\u05e9\u05d1\u05ea \u05d0\u05ea \u05d4\u05de\u05d7\u05d9\u05e8 \u05d0\u05d7\u05e8\u05d9 \u05d4\u05e0\u05d7\u05d4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u05ea\u05e8\u05d2\u05d9\u05dc 3:<\/strong><br>\u05e6\u05e8\u05d5 \u05de\u05e2\u05e8\u05db\u05ea \u05e8\u05d9\u05e9\u05d5\u05dd \u05e9\u05dc \u05de\u05e9\u05ea\u05de\u05e9\u05d9\u05dd \u05e2\u05dd \u05de\u05d7\u05dc\u05e7\u05d5\u05ea <code>User<\/code>, <code>Admin<\/code> \u05d5-<code>Guest<\/code>. \u05db\u05dc \u05de\u05d7\u05dc\u05e7\u05d4 \u05ea\u05db\u05dc\u05d5\u05dc \u05e9\u05d9\u05d8\u05d4 <code>get_permissions<\/code> \u05e9\u05ea\u05e9\u05d9\u05d1 \u05d4\u05e8\u05e9\u05d0\u05d5\u05ea \u05e9\u05d5\u05e0\u05d5\u05ea.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u05ea\u05e8\u05d2\u05d9\u05dc 4:<\/strong><br>\u05db\u05ea\u05d1\u05d5 \u05de\u05d7\u05dc\u05e7\u05d4 <code>Shape<\/code> \u05e2\u05dd \u05e9\u05d9\u05d8\u05d4 <code>area<\/code>. \u05e6\u05e8\u05d5 \u05de\u05d7\u05dc\u05e7\u05d5\u05ea \u05d9\u05d5\u05e8\u05e9\u05d5\u05ea <code>Circle<\/code> \u05d5-<code>Rectangle<\/code> \u05e9\u05de\u05d7\u05e9\u05d1\u05d5\u05ea \u05e9\u05d8\u05d7 \u05d1\u05d3\u05e8\u05db\u05d9\u05dd \u05e9\u05d5\u05e0\u05d5\u05ea.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u05ea\u05e8\u05d2\u05d9\u05dc 5:<\/strong><br>\u05d0\u05ea\u05d2\u05e8: \u05e6\u05e8\u05d5 \u05de\u05d7\u05dc\u05e7\u05d4 <code>Account<\/code> \u05e2\u05dd \u05de\u05d7\u05dc\u05e7\u05d5\u05ea \u05d9\u05d5\u05e8\u05e9\u05d5\u05ea <code>SavingsAccount<\/code> \u05d5-<code>CheckingAccount<\/code>, \u05db\u05d0\u05e9\u05e8 \u05db\u05dc \u05d0\u05d7\u05ea \u05de\u05d4\u05df \u05de\u05d7\u05e9\u05d1\u05ea \u05e8\u05d9\u05d1\u05d9\u05ea \u05d1\u05e6\u05d5\u05e8\u05d4 \u05e9\u05d5\u05e0\u05d4.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u05d4\u05e4\u05e8\u05d5\u05d9\u05e7\u05d8 \u05d4\u05d2\u05d3\u05d5\u05dc: \u05de\u05e9\u05d7\u05e7 \u05d4\u05d8\u05e8\u05d9\u05d5\u05d5\u05d9\u05d4<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u05e0\u05e9\u05ea\u05de\u05e9 \u05d1-OOP \u05db\u05d3\u05d9 \u05dc\u05d9\u05d9\u05e6\u05d2 \u05e9\u05d0\u05dc\u05d5\u05ea, \u05e9\u05d7\u05e7\u05e0\u05d9\u05dd, \u05d5\u05d0\u05ea \u05e0\u05d9\u05d4\u05d5\u05dc \u05d4\u05de\u05e9\u05d7\u05e7 \u05db\u05d5\u05dc\u05d5.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u05de\u05d7\u05dc\u05e7\u05d4 <code>Question<\/code> &#8211; \u05d9\u05d9\u05e6\u05d5\u05d2 \u05e9\u05d0\u05dc\u05d4.<\/strong><\/li>\n\n\n\n<li><strong>\u05de\u05d7\u05dc\u05e7\u05d4 <code>Player<\/code> &#8211; \u05d9\u05d9\u05e6\u05d5\u05d2 \u05e9\u05d7\u05e7\u05df \u05e2\u05dd \u05e0\u05d9\u05e7\u05d5\u05d3.<\/strong><\/li>\n\n\n\n<li><strong>\u05de\u05d7\u05dc\u05e7\u05d4 <code>QuizGame<\/code> &#8211; \u05e0\u05d9\u05d4\u05d5\u05dc \u05d4\u05de\u05e9\u05d7\u05e7.<\/strong><\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">\u05e7\u05d5\u05d1\u05e5 <code>question.py<\/code><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nclass Question:\n    &quot;&quot;&quot;A class to represent a quiz question.&quot;&quot;&quot;\n    def __init__(self, text, answer):\n        self.text = text\n        self.answer = answer\n\n    def is_correct(self, user_answer):\n        &quot;&quot;&quot;Check if the user&#039;s answer is correct.&quot;&quot;&quot;\n        return str(user_answer).lower() == str(self.answer).lower()\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u05e7\u05d5\u05d1\u05e5 <code>player.py<\/code><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nclass Player:\n    &quot;&quot;&quot;A class to represent a player.&quot;&quot;&quot;\n    def __init__(self, name):\n        self.name = name\n        self.score = 0\n\n    def add_score(self, points):\n        &quot;&quot;&quot;Add points to the player&#039;s score.&quot;&quot;&quot;\n        self.score += points\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u05e7\u05d5\u05d1\u05e5 <code>quiz_game.py<\/code><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfrom question import Question\nfrom player import Player\n\nclass QuizGame:\n    &quot;&quot;&quot;A class to manage the quiz game.&quot;&quot;&quot;\n    def __init__(self, questions):\n        self.questions = questions  # List of Question objects\n\n    def start(self, player_name):\n        &quot;&quot;&quot;Start the game for a player.&quot;&quot;&quot;\n        player = Player(player_name)\n        for question in self.questions:\n            print(&quot;\\n&quot; + question.text)\n            user_answer = input(&quot;Your answer: &quot;).strip()\n            if question.is_correct(user_answer):\n                print(&quot;Correct!&quot;)\n                player.add_score(1)\n            else:\n                print(f&quot;Wrong! The correct answer was: {question.answer}&quot;)\n        print(f&quot;\\n{player.name}, your final score is: {player.score}&quot;)\n\n    def manage_questions(self):\n        &quot;&quot;&quot;Allow admin to manage questions.&quot;&quot;&quot;\n        while True:\n            action = input(&quot;\\nDo you want to &#039;add&#039;, &#039;edit&#039;, &#039;remove&#039;, or &#039;done&#039;? &quot;).lower().strip()\n            if action == &quot;done&quot;:\n                break\n            elif action == &quot;add&quot;:\n                new_text = input(&quot;Enter the question text: &quot;).strip()\n                new_answer = input(&quot;Enter the correct answer: &quot;).strip()\n                self.questions.append(Question(new_text, new_answer))\n                print(&quot;Question added!&quot;)\n            elif action == &quot;edit&quot;:\n                question_number = int(input(&quot;Enter the question number to edit (1-based index): &quot;)) - 1\n                if 0 &lt;= question_number &lt; len(self.questions):\n                    new_text = input(&quot;Enter the new question text: &quot;).strip()\n                    new_answer = input(&quot;Enter the new correct answer: &quot;).strip()\n                    self.questions&#x5B;question_number].text = new_text\n                    self.questions&#x5B;question_number].answer = new_answer\n                    print(&quot;Question updated!&quot;)\n                else:\n                    print(&quot;Invalid question number.&quot;)\n            elif action == &quot;remove&quot;:\n                question_number = int(input(&quot;Enter the question number to remove (1-based index): &quot;)) - 1\n                if 0 &lt;= question_number &lt; len(self.questions):\n                    removed_question = self.questions.pop(question_number)\n                    print(f&quot;Removed question: {removed_question.text}&quot;)\n                else:\n                    print(&quot;Invalid question number.&quot;)\n            else:\n                print(&quot;Invalid action. Please choose &#039;add&#039;, &#039;edit&#039;, &#039;remove&#039;, or &#039;done&#039;.&quot;)\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u05e7\u05d5\u05d1\u05e5 <code>main.py<\/code><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfrom question import Question\nfrom quiz_game import QuizGame\n\ndef load_questions():\n    &quot;&quot;&quot;Load questions from a file and return a list of Question objects.&quot;&quot;&quot;\n    questions = &#x5B;]\n    try:\n        with open(&quot;questions.txt&quot;, &quot;r&quot;) as file:\n            for line in file:\n                text, answer = line.strip().split(&quot;||&quot;)\n                questions.append(Question(text, answer))\n    except FileNotFoundError:\n        print(&quot;Questions file not found. Starting with no questions.&quot;)\n    return questions\n\ndef save_questions(questions):\n    &quot;&quot;&quot;Save questions to a file.&quot;&quot;&quot;\n    with open(&quot;questions.txt&quot;, &quot;w&quot;) as file:\n        for question in questions:\n            file.write(f&quot;{question.text}||{question.answer}\\n&quot;)\n\ndef main():\n    &quot;&quot;&quot;Main function to run the quiz game.&quot;&quot;&quot;\n    questions = load_questions()\n    quiz = QuizGame(questions)\n\n    name = input(&quot;Enter your name: &quot;).strip()\n    if name.lower() == &quot;admin&quot;:\n        print(&quot;Welcome, Admin!&quot;)\n        quiz.manage_questions()\n        save_questions(quiz.questions)\n    else:\n        print(f&quot;Welcome, {name}!&quot;)\n        quiz.start(name)\n\nif __name__ == &quot;__main__&quot;:\n    main()\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\"><strong>\u05d4\u05e1\u05d1\u05e8 \u05e2\u05dc \u05d4\u05e7\u05d5\u05d3<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 <code>manage_questions<\/code> \u05d1\u05de\u05d7\u05dc\u05e7\u05d4 <code>QuizGame<\/code>:<\/strong>\n<ul class=\"wp-block-list\">\n<li>\u05de\u05d0\u05e4\u05e9\u05e8\u05ea \u05dc\u05de\u05e0\u05d4\u05dc \u05dc\u05d1\u05e6\u05e2 \u05d0\u05ea \u05d4\u05e4\u05e2\u05d5\u05dc\u05d5\u05ea \u05d4\u05d1\u05d0\u05d5\u05ea:\n<ul class=\"wp-block-list\">\n<li><strong>\u05d4\u05d5\u05e1\u05e4\u05d4 (<code>add<\/code>)<\/strong>: \u05d4\u05d5\u05e1\u05e4\u05ea \u05e9\u05d0\u05dc\u05d4 \u05d7\u05d3\u05e9\u05d4 \u05dc\u05e8\u05e9\u05d9\u05de\u05d4.<\/li>\n\n\n\n<li><strong>\u05e2\u05e8\u05d9\u05db\u05d4 (<code>edit<\/code>)<\/strong>: \u05e9\u05d9\u05e0\u05d5\u05d9 \u05d4\u05d8\u05e7\u05e1\u05d8 \u05d0\u05d5 \u05d4\u05ea\u05e9\u05d5\u05d1\u05d4 \u05e9\u05dc \u05e9\u05d0\u05dc\u05d4 \u05e7\u05d9\u05d9\u05de\u05ea.<\/li>\n\n\n\n<li><strong>\u05de\u05d7\u05d9\u05e7\u05d4 (<code>remove<\/code>)<\/strong>: \u05d4\u05e1\u05e8\u05ea \u05e9\u05d0\u05dc\u05d4 \u05de\u05d4\u05e8\u05e9\u05d9\u05de\u05d4.<\/li>\n\n\n\n<li><strong>\u05e1\u05d9\u05d5\u05dd (<code>done<\/code>)<\/strong>: \u05d9\u05e6\u05d9\u05d0\u05d4 \u05de\u05de\u05e1\u05da \u05e0\u05d9\u05d4\u05d5\u05dc \u05d4\u05e9\u05d0\u05dc\u05d5\u05ea.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u05d8\u05e2\u05d9\u05e0\u05ea \u05d5\u05e9\u05de\u05d9\u05e8\u05ea \u05e9\u05d0\u05dc\u05d5\u05ea:<\/strong>\n<ul class=\"wp-block-list\">\n<li>\u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 <code>load_questions<\/code> \u05d8\u05d5\u05e2\u05e0\u05ea \u05e9\u05d0\u05dc\u05d5\u05ea \u05de\u05e7\u05d5\u05d1\u05e5 <code>questions.txt<\/code> \u05d5\u05de\u05de\u05d9\u05e8\u05d4 \u05d0\u05d5\u05ea\u05df \u05dc\u05d0\u05d5\u05d1\u05d9\u05d9\u05e7\u05d8\u05d9\u05dd \u05e9\u05dc <code>Question<\/code>.<\/li>\n\n\n\n<li>\u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 <code>save_questions<\/code> \u05e9\u05d5\u05de\u05e8\u05ea \u05d0\u05ea \u05e8\u05e9\u05d9\u05de\u05ea \u05d4\u05e9\u05d0\u05dc\u05d5\u05ea \u05d4\u05de\u05e2\u05d5\u05d3\u05db\u05e0\u05ea \u05dc\u05e7\u05d5\u05d1\u05e5.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u05d6\u05e8\u05d9\u05de\u05ea \u05d4\u05ea\u05d5\u05db\u05e0\u05d9\u05ea:<\/strong>\n<ul class=\"wp-block-list\">\n<li>\u05d0\u05dd \u05d4\u05de\u05e9\u05ea\u05de\u05e9 \u05d4\u05d5\u05d0 \u05de\u05e0\u05d4\u05dc (<code>admin<\/code>), \u05de\u05d5\u05e4\u05e2\u05dc\u05ea \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d9\u05ea <code>manage_questions<\/code>.<\/li>\n\n\n\n<li>\u05dc\u05d0\u05d7\u05e8 \u05d4\u05e0\u05d9\u05d4\u05d5\u05dc, \u05d4\u05e9\u05d0\u05dc\u05d5\u05ea \u05d4\u05de\u05e2\u05d5\u05d3\u05db\u05e0\u05d5\u05ea \u05e0\u05e9\u05de\u05e8\u05d5\u05ea \u05dc\u05e7\u05d5\u05d1\u05e5.<\/li>\n\n\n\n<li>\u05d0\u05dd \u05d4\u05de\u05e9\u05ea\u05de\u05e9 \u05d4\u05d5\u05d0 \u05e9\u05d7\u05e7\u05df \u05e8\u05d2\u05d9\u05dc, \u05d4\u05de\u05e9\u05d7\u05e7 \u05de\u05ea\u05d7\u05d9\u05dc \u05e2\u05dd \u05e8\u05e9\u05d9\u05de\u05ea \u05d4\u05e9\u05d0\u05dc\u05d5\u05ea \u05d4\u05d8\u05e2\u05d5\u05e0\u05d4.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u05d3\u05d5\u05d2\u05de\u05d4 \u05dc\u05d4\u05e8\u05e6\u05d4<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u05de\u05e0\u05d4\u05dc \u05e0\u05db\u05e0\u05e1:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nEnter your name: admin\nWelcome, Admin!\n\nDo you want to &#039;add&#039;, &#039;edit&#039;, &#039;remove&#039;, or &#039;done&#039;? add\nEnter the question text: What is the capital of Japan?\nEnter the correct answer: Tokyo\nQuestion added!\n\nDo you want to &#039;add&#039;, &#039;edit&#039;, &#039;remove&#039;, or &#039;done&#039;? done\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\"><strong>\u05e9\u05d7\u05e7\u05df \u05e8\u05d2\u05d9\u05dc \u05e0\u05db\u05e0\u05e1:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nEnter your name: Alice\nWelcome, Alice!\n\nWhat is the capital of Japan?\nYour answer: Tokyo\nCorrect!\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>\u05ea\u05db\u05e0\u05d5\u05ea \u05de\u05d5\u05e0\u05d7\u05d4 \u05e2\u05e6\u05de\u05d9\u05dd (OOP) \u05d4\u05d5\u05d0 \u05e1\u05d2\u05e0\u05d5\u05df \u05ea\u05db\u05e0\u05d5\u05ea \u05d4\u05de\u05d0\u05e4\u05e9\u05e8 \u05e2\u05d1\u05d5\u05d3\u05d4 \u05e2\u05dd \u05de\u05d7\u05dc\u05e7\u05d5\u05ea (Classes) \u05d5-\u05d0\u05d5\u05d1\u05d9\u05d9\u05e7\u05d8\u05d9\u05dd (Objects) \u05db\u05d3\u05d9 \u05dc\u05d0\u05e8\u05d2\u05df \u05e7\u05d5\u05d3 \u05d1\u05e6\u05d5\u05e8\u05d4 \u05d9\u05e2\u05d9\u05dc\u05d4 \u05d5\u05e0\u05d9\u05ea\u05e0\u05ea \u05dc\u05e9\u05d9\u05de\u05d5\u05e9 \u05d7\u05d5\u05d6\u05e8. \u05de\u05d5\u05e9\u05d2\u05d9\u05dd \u05de\u05e8\u05db\u05d6\u05d9\u05d9\u05dd: \u05de\u05d7\u05dc\u05e7\u05d5\u05ea \u05d5\u05d0\u05d5\u05d1\u05d9\u05d9\u05e7\u05d8\u05d9\u05dd \u05d3\u05d5\u05d2\u05de\u05ea \u05e7\u05d5\u05d3: \u05e0\u05d9\u05d4\u05d5\u05dc \u05e2\u05d5\u05d1\u05d3\u05d9\u05dd \u05d4\u05e1\u05d1\u05e8 \u05e2\u05dc \u05d4\u05e7\u05d5\u05d3 \u05d9\u05e8\u05d5\u05e9\u05d4 \u05d3\u05d5\u05d2\u05de\u05ea \u05e7\u05d5\u05d3: \u05de\u05d7\u05dc\u05e7\u05ea \u05e2\u05d5\u05d1\u05d3\u05d9\u05dd \u05d5\u05de\u05e0\u05d4\u05dc\u05d9\u05dd \u05d4\u05e1\u05d1\u05e8 \u05e2\u05dc \u05d4\u05e7\u05d5\u05d3 \u05e4\u05d5\u05dc\u05d9\u05de\u05d5\u05e8\u05e4\u05d9\u05d6\u05dd \u05d3\u05d5\u05d2\u05de\u05ea \u05e7\u05d5\u05d3: \u05de\u05e2\u05e8\u05db\u05ea \u05e9\u05db\u05e8 \u05d4\u05e1\u05d1\u05e8 \u05e2\u05dc \u05d4\u05e7\u05d5\u05d3 \u05ea\u05e8\u05d2\u05d9\u05dc\u05d9\u05dd \u05ea\u05e8\u05d2\u05d9\u05dc 1:\u05e6\u05e8\u05d5 \u05de\u05d7\u05dc\u05e7\u05d4 Product [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"","ocean_second_sidebar":"","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"","ocean_custom_header_template":"","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"","ocean_menu_typo_font_family":"","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"on","ocean_gallery_id":[],"footnotes":""},"categories":[82],"tags":[],"class_list":["post-2095","post","type-post","status-publish","format-standard","hentry","category-python-course","entry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u05ea\u05db\u05e0\u05d5\u05ea \u05de\u05d5\u05e0\u05d7\u05d4 \u05e2\u05e6\u05de\u05d9\u05dd (Object-Oriented Programming - OOP) - Code Notebook<\/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:\/\/epicmarketing.co.il\/notebook\/python-object-oriented-programming\/\" \/>\n<meta property=\"og:locale\" content=\"he_IL\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u05ea\u05db\u05e0\u05d5\u05ea \u05de\u05d5\u05e0\u05d7\u05d4 \u05e2\u05e6\u05de\u05d9\u05dd (Object-Oriented Programming - OOP) - Code Notebook\" \/>\n<meta property=\"og:description\" content=\"\u05ea\u05db\u05e0\u05d5\u05ea \u05de\u05d5\u05e0\u05d7\u05d4 \u05e2\u05e6\u05de\u05d9\u05dd (OOP) \u05d4\u05d5\u05d0 \u05e1\u05d2\u05e0\u05d5\u05df \u05ea\u05db\u05e0\u05d5\u05ea \u05d4\u05de\u05d0\u05e4\u05e9\u05e8 \u05e2\u05d1\u05d5\u05d3\u05d4 \u05e2\u05dd \u05de\u05d7\u05dc\u05e7\u05d5\u05ea (Classes) \u05d5-\u05d0\u05d5\u05d1\u05d9\u05d9\u05e7\u05d8\u05d9\u05dd (Objects) \u05db\u05d3\u05d9 \u05dc\u05d0\u05e8\u05d2\u05df \u05e7\u05d5\u05d3 \u05d1\u05e6\u05d5\u05e8\u05d4 \u05d9\u05e2\u05d9\u05dc\u05d4 \u05d5\u05e0\u05d9\u05ea\u05e0\u05ea \u05dc\u05e9\u05d9\u05de\u05d5\u05e9 \u05d7\u05d5\u05d6\u05e8. \u05de\u05d5\u05e9\u05d2\u05d9\u05dd \u05de\u05e8\u05db\u05d6\u05d9\u05d9\u05dd: \u05de\u05d7\u05dc\u05e7\u05d5\u05ea \u05d5\u05d0\u05d5\u05d1\u05d9\u05d9\u05e7\u05d8\u05d9\u05dd \u05d3\u05d5\u05d2\u05de\u05ea \u05e7\u05d5\u05d3: \u05e0\u05d9\u05d4\u05d5\u05dc \u05e2\u05d5\u05d1\u05d3\u05d9\u05dd \u05d4\u05e1\u05d1\u05e8 \u05e2\u05dc \u05d4\u05e7\u05d5\u05d3 \u05d9\u05e8\u05d5\u05e9\u05d4 \u05d3\u05d5\u05d2\u05de\u05ea \u05e7\u05d5\u05d3: \u05de\u05d7\u05dc\u05e7\u05ea \u05e2\u05d5\u05d1\u05d3\u05d9\u05dd \u05d5\u05de\u05e0\u05d4\u05dc\u05d9\u05dd \u05d4\u05e1\u05d1\u05e8 \u05e2\u05dc \u05d4\u05e7\u05d5\u05d3 \u05e4\u05d5\u05dc\u05d9\u05de\u05d5\u05e8\u05e4\u05d9\u05d6\u05dd \u05d3\u05d5\u05d2\u05de\u05ea \u05e7\u05d5\u05d3: \u05de\u05e2\u05e8\u05db\u05ea \u05e9\u05db\u05e8 \u05d4\u05e1\u05d1\u05e8 \u05e2\u05dc \u05d4\u05e7\u05d5\u05d3 \u05ea\u05e8\u05d2\u05d9\u05dc\u05d9\u05dd \u05ea\u05e8\u05d2\u05d9\u05dc 1:\u05e6\u05e8\u05d5 \u05de\u05d7\u05dc\u05e7\u05d4 Product [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/epicmarketing.co.il\/notebook\/python-object-oriented-programming\/\" \/>\n<meta property=\"og:site_name\" content=\"Code Notebook\" \/>\n<meta property=\"article:published_time\" content=\"2024-12-05T09:37:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-12-05T09:39:36+00:00\" \/>\n<meta name=\"author\" content=\"kerendanino\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u05e0\u05db\u05ea\u05d1 \u05e2\u05dc \u05d9\u05d3\" \/>\n\t<meta name=\"twitter:data1\" content=\"kerendanino\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u05d6\u05de\u05df \u05e7\u05e8\u05d9\u05d0\u05d4 \u05de\u05d5\u05e2\u05e8\u05da\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u05d3\u05e7\u05d5\u05ea\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/python-object-oriented-programming\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/python-object-oriented-programming\\\/\"},\"author\":{\"name\":\"kerendanino\",\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/#\\\/schema\\\/person\\\/195dfc625818eadda7903d456890e24c\"},\"headline\":\"\u05ea\u05db\u05e0\u05d5\u05ea \u05de\u05d5\u05e0\u05d7\u05d4 \u05e2\u05e6\u05de\u05d9\u05dd (Object-Oriented Programming &#8211; OOP)\",\"datePublished\":\"2024-12-05T09:37:33+00:00\",\"dateModified\":\"2024-12-05T09:39:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/python-object-oriented-programming\\\/\"},\"wordCount\":26,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/#organization\"},\"articleSection\":[\"\u05e7\u05d5\u05e8\u05e1 Python\"],\"inLanguage\":\"he-IL\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/python-object-oriented-programming\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/python-object-oriented-programming\\\/\",\"url\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/python-object-oriented-programming\\\/\",\"name\":\"\u05ea\u05db\u05e0\u05d5\u05ea \u05de\u05d5\u05e0\u05d7\u05d4 \u05e2\u05e6\u05de\u05d9\u05dd (Object-Oriented Programming - OOP) - Code Notebook\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/#website\"},\"datePublished\":\"2024-12-05T09:37:33+00:00\",\"dateModified\":\"2024-12-05T09:39:36+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/python-object-oriented-programming\\\/#breadcrumb\"},\"inLanguage\":\"he-IL\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/python-object-oriented-programming\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/python-object-oriented-programming\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u05ea\u05db\u05e0\u05d5\u05ea \u05de\u05d5\u05e0\u05d7\u05d4 \u05e2\u05e6\u05de\u05d9\u05dd (Object-Oriented Programming &#8211; OOP)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/#website\",\"url\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/\",\"name\":\"Code Notebook\",\"description\":\"Easy coding\",\"publisher\":{\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"he-IL\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/#organization\",\"name\":\"Code Notebook\",\"url\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"he-IL\",\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/logo-epic-marketing-05.png\",\"contentUrl\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/logo-epic-marketing-05.png\",\"width\":3626,\"height\":1942,\"caption\":\"Code Notebook\"},\"image\":{\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/#\\\/schema\\\/person\\\/195dfc625818eadda7903d456890e24c\",\"name\":\"kerendanino\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"he-IL\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/285cc9389c66aa46da1e26a474b1e90e9efaf3fa21f1b928cbd63ce5f0e89c63?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/285cc9389c66aa46da1e26a474b1e90e9efaf3fa21f1b928cbd63ce5f0e89c63?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/285cc9389c66aa46da1e26a474b1e90e9efaf3fa21f1b928cbd63ce5f0e89c63?s=96&d=mm&r=g\",\"caption\":\"kerendanino\"},\"url\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/author\\\/kerendanino\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u05ea\u05db\u05e0\u05d5\u05ea \u05de\u05d5\u05e0\u05d7\u05d4 \u05e2\u05e6\u05de\u05d9\u05dd (Object-Oriented Programming - OOP) - Code Notebook","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:\/\/epicmarketing.co.il\/notebook\/python-object-oriented-programming\/","og_locale":"he_IL","og_type":"article","og_title":"\u05ea\u05db\u05e0\u05d5\u05ea \u05de\u05d5\u05e0\u05d7\u05d4 \u05e2\u05e6\u05de\u05d9\u05dd (Object-Oriented Programming - OOP) - Code Notebook","og_description":"\u05ea\u05db\u05e0\u05d5\u05ea \u05de\u05d5\u05e0\u05d7\u05d4 \u05e2\u05e6\u05de\u05d9\u05dd (OOP) \u05d4\u05d5\u05d0 \u05e1\u05d2\u05e0\u05d5\u05df \u05ea\u05db\u05e0\u05d5\u05ea \u05d4\u05de\u05d0\u05e4\u05e9\u05e8 \u05e2\u05d1\u05d5\u05d3\u05d4 \u05e2\u05dd \u05de\u05d7\u05dc\u05e7\u05d5\u05ea (Classes) \u05d5-\u05d0\u05d5\u05d1\u05d9\u05d9\u05e7\u05d8\u05d9\u05dd (Objects) \u05db\u05d3\u05d9 \u05dc\u05d0\u05e8\u05d2\u05df \u05e7\u05d5\u05d3 \u05d1\u05e6\u05d5\u05e8\u05d4 \u05d9\u05e2\u05d9\u05dc\u05d4 \u05d5\u05e0\u05d9\u05ea\u05e0\u05ea \u05dc\u05e9\u05d9\u05de\u05d5\u05e9 \u05d7\u05d5\u05d6\u05e8. \u05de\u05d5\u05e9\u05d2\u05d9\u05dd \u05de\u05e8\u05db\u05d6\u05d9\u05d9\u05dd: \u05de\u05d7\u05dc\u05e7\u05d5\u05ea \u05d5\u05d0\u05d5\u05d1\u05d9\u05d9\u05e7\u05d8\u05d9\u05dd \u05d3\u05d5\u05d2\u05de\u05ea \u05e7\u05d5\u05d3: \u05e0\u05d9\u05d4\u05d5\u05dc \u05e2\u05d5\u05d1\u05d3\u05d9\u05dd \u05d4\u05e1\u05d1\u05e8 \u05e2\u05dc \u05d4\u05e7\u05d5\u05d3 \u05d9\u05e8\u05d5\u05e9\u05d4 \u05d3\u05d5\u05d2\u05de\u05ea \u05e7\u05d5\u05d3: \u05de\u05d7\u05dc\u05e7\u05ea \u05e2\u05d5\u05d1\u05d3\u05d9\u05dd \u05d5\u05de\u05e0\u05d4\u05dc\u05d9\u05dd \u05d4\u05e1\u05d1\u05e8 \u05e2\u05dc \u05d4\u05e7\u05d5\u05d3 \u05e4\u05d5\u05dc\u05d9\u05de\u05d5\u05e8\u05e4\u05d9\u05d6\u05dd \u05d3\u05d5\u05d2\u05de\u05ea \u05e7\u05d5\u05d3: \u05de\u05e2\u05e8\u05db\u05ea \u05e9\u05db\u05e8 \u05d4\u05e1\u05d1\u05e8 \u05e2\u05dc \u05d4\u05e7\u05d5\u05d3 \u05ea\u05e8\u05d2\u05d9\u05dc\u05d9\u05dd \u05ea\u05e8\u05d2\u05d9\u05dc 1:\u05e6\u05e8\u05d5 \u05de\u05d7\u05dc\u05e7\u05d4 Product [&hellip;]","og_url":"https:\/\/epicmarketing.co.il\/notebook\/python-object-oriented-programming\/","og_site_name":"Code Notebook","article_published_time":"2024-12-05T09:37:33+00:00","article_modified_time":"2024-12-05T09:39:36+00:00","author":"kerendanino","twitter_card":"summary_large_image","twitter_misc":{"\u05e0\u05db\u05ea\u05d1 \u05e2\u05dc \u05d9\u05d3":"kerendanino","\u05d6\u05de\u05df \u05e7\u05e8\u05d9\u05d0\u05d4 \u05de\u05d5\u05e2\u05e8\u05da":"2 \u05d3\u05e7\u05d5\u05ea"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/epicmarketing.co.il\/notebook\/python-object-oriented-programming\/#article","isPartOf":{"@id":"https:\/\/epicmarketing.co.il\/notebook\/python-object-oriented-programming\/"},"author":{"name":"kerendanino","@id":"https:\/\/epicmarketing.co.il\/notebook\/#\/schema\/person\/195dfc625818eadda7903d456890e24c"},"headline":"\u05ea\u05db\u05e0\u05d5\u05ea \u05de\u05d5\u05e0\u05d7\u05d4 \u05e2\u05e6\u05de\u05d9\u05dd (Object-Oriented Programming &#8211; OOP)","datePublished":"2024-12-05T09:37:33+00:00","dateModified":"2024-12-05T09:39:36+00:00","mainEntityOfPage":{"@id":"https:\/\/epicmarketing.co.il\/notebook\/python-object-oriented-programming\/"},"wordCount":26,"commentCount":0,"publisher":{"@id":"https:\/\/epicmarketing.co.il\/notebook\/#organization"},"articleSection":["\u05e7\u05d5\u05e8\u05e1 Python"],"inLanguage":"he-IL","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/epicmarketing.co.il\/notebook\/python-object-oriented-programming\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/epicmarketing.co.il\/notebook\/python-object-oriented-programming\/","url":"https:\/\/epicmarketing.co.il\/notebook\/python-object-oriented-programming\/","name":"\u05ea\u05db\u05e0\u05d5\u05ea \u05de\u05d5\u05e0\u05d7\u05d4 \u05e2\u05e6\u05de\u05d9\u05dd (Object-Oriented Programming - OOP) - Code Notebook","isPartOf":{"@id":"https:\/\/epicmarketing.co.il\/notebook\/#website"},"datePublished":"2024-12-05T09:37:33+00:00","dateModified":"2024-12-05T09:39:36+00:00","breadcrumb":{"@id":"https:\/\/epicmarketing.co.il\/notebook\/python-object-oriented-programming\/#breadcrumb"},"inLanguage":"he-IL","potentialAction":[{"@type":"ReadAction","target":["https:\/\/epicmarketing.co.il\/notebook\/python-object-oriented-programming\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/epicmarketing.co.il\/notebook\/python-object-oriented-programming\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/epicmarketing.co.il\/notebook\/"},{"@type":"ListItem","position":2,"name":"\u05ea\u05db\u05e0\u05d5\u05ea \u05de\u05d5\u05e0\u05d7\u05d4 \u05e2\u05e6\u05de\u05d9\u05dd (Object-Oriented Programming &#8211; OOP)"}]},{"@type":"WebSite","@id":"https:\/\/epicmarketing.co.il\/notebook\/#website","url":"https:\/\/epicmarketing.co.il\/notebook\/","name":"Code Notebook","description":"Easy coding","publisher":{"@id":"https:\/\/epicmarketing.co.il\/notebook\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/epicmarketing.co.il\/notebook\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"he-IL"},{"@type":"Organization","@id":"https:\/\/epicmarketing.co.il\/notebook\/#organization","name":"Code Notebook","url":"https:\/\/epicmarketing.co.il\/notebook\/","logo":{"@type":"ImageObject","inLanguage":"he-IL","@id":"https:\/\/epicmarketing.co.il\/notebook\/#\/schema\/logo\/image\/","url":"https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/07\/logo-epic-marketing-05.png","contentUrl":"https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/07\/logo-epic-marketing-05.png","width":3626,"height":1942,"caption":"Code Notebook"},"image":{"@id":"https:\/\/epicmarketing.co.il\/notebook\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/epicmarketing.co.il\/notebook\/#\/schema\/person\/195dfc625818eadda7903d456890e24c","name":"kerendanino","image":{"@type":"ImageObject","inLanguage":"he-IL","@id":"https:\/\/secure.gravatar.com\/avatar\/285cc9389c66aa46da1e26a474b1e90e9efaf3fa21f1b928cbd63ce5f0e89c63?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/285cc9389c66aa46da1e26a474b1e90e9efaf3fa21f1b928cbd63ce5f0e89c63?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/285cc9389c66aa46da1e26a474b1e90e9efaf3fa21f1b928cbd63ce5f0e89c63?s=96&d=mm&r=g","caption":"kerendanino"},"url":"https:\/\/epicmarketing.co.il\/notebook\/author\/kerendanino\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/epicmarketing.co.il\/notebook\/wp-json\/wp\/v2\/posts\/2095","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/epicmarketing.co.il\/notebook\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/epicmarketing.co.il\/notebook\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/epicmarketing.co.il\/notebook\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/epicmarketing.co.il\/notebook\/wp-json\/wp\/v2\/comments?post=2095"}],"version-history":[{"count":2,"href":"https:\/\/epicmarketing.co.il\/notebook\/wp-json\/wp\/v2\/posts\/2095\/revisions"}],"predecessor-version":[{"id":2097,"href":"https:\/\/epicmarketing.co.il\/notebook\/wp-json\/wp\/v2\/posts\/2095\/revisions\/2097"}],"wp:attachment":[{"href":"https:\/\/epicmarketing.co.il\/notebook\/wp-json\/wp\/v2\/media?parent=2095"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/epicmarketing.co.il\/notebook\/wp-json\/wp\/v2\/categories?post=2095"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/epicmarketing.co.il\/notebook\/wp-json\/wp\/v2\/tags?post=2095"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}