Skip to content

Commit

Permalink
used extend to self.skills, del init in FullStackDeveloper
Browse files Browse the repository at this point in the history
  • Loading branch information
MahdaArtem-py committed Sep 3, 2024
1 parent e108155 commit 2448404
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def learn_skill(self, skill: str) -> None:
class FrontendDeveloper(SoftwareEngineer):
def __init__(self, name: str) -> None:
super().__init__(name)
self.skills = ["JavaScript", "HTML", "CSS"]
self.skills.extend(["JavaScript", "HTML", "CSS"])

def create_awesome_web_page(self) -> str:
print(f"{self.name} is creating a webpage...")
Expand All @@ -21,7 +21,7 @@ def create_awesome_web_page(self) -> str:
class BackendDeveloper(SoftwareEngineer):
def __init__(self, name: str) -> None:
super().__init__(name)
self.skills = ["Python", "SQL", "Django"]
self.skills.extend(["Python", "SQL", "Django"])

def create_powerful_api(self) -> str:
print(f"{self.name} is creating an API...")
Expand All @@ -31,20 +31,14 @@ def create_powerful_api(self) -> str:
class AndroidDeveloper(SoftwareEngineer):
def __init__(self, name: str) -> None:
super().__init__(name)
self.skills = ["Java", "Android studio"]
self.skills.extend(["Java", "Android studio"])

def create_smooth_mobile_app(self) -> str:
print(f"{self.name} is creating a mobile app...")
return "Ads every three swipes"


class FullStackDeveloper(FrontendDeveloper, BackendDeveloper):
def __init__(self, name: str) -> None:
FrontendDeveloper.__init__(self, name)
BackendDeveloper.__init__(self, name)
self.skills = list(set(FrontendDeveloper(name).skills
+ BackendDeveloper(name).skills))

def create_web_application(self) -> None:
print(f"{self.name} started creating a web application...")
self.create_powerful_api()
Expand Down

0 comments on commit 2448404

Please sign in to comment.