From 2c851197ad94fb1554582f229fef040bdddfe942 Mon Sep 17 00:00:00 2001 From: Oleh Date: Wed, 2 Oct 2024 17:09:05 +0300 Subject: [PATCH 1/2] Solution --- app/main.py | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index fa56336e..5a5c9d86 100644 --- a/app/main.py +++ b/app/main.py @@ -1 +1,46 @@ -# write your code here +class SoftwareEngineer: + def __init__(self, name: str) -> None: + self.name = name + self.skills = [] + + def learn_skill(self, skill: str) -> None: + if skill not in self.skills: + self.skills.append(skill) + + +class FrontendDeveloper(SoftwareEngineer): + def __init__(self, name: str) -> None: + super().__init__(name) + self.skills.extend(["JavaScript", "HTML", "CSS"]) + + def create_awesome_web_page(self) -> str: + print(f"{self.name} is creating a webpage...") + return "

Hello world

" + + +class BackendDeveloper(SoftwareEngineer): + def __init__(self, name: str) -> None: + super().__init__(name) + self.skills.extend(["SQL", "Python", "Django"]) + + def create_powerful_api(self) -> str: + print(f"{self.name} is creating an API...") + return "http://127.0.0.1:8000" + + +class AndroidDeveloper(SoftwareEngineer): + def __init__(self, name: str) -> None: + super().__init__(name) + 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 create_web_application(self) -> None: + print(f"{self.name} started creating a web application...") + super().create_powerful_api() + super().create_awesome_web_page() From 954218b22a4e4f42af64c99220953e891df1c29b Mon Sep 17 00:00:00 2001 From: Oleh Date: Wed, 2 Oct 2024 17:09:57 +0300 Subject: [PATCH 2/2] Solution --- app/main.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/main.py b/app/main.py index 5a5c9d86..d9104467 100644 --- a/app/main.py +++ b/app/main.py @@ -4,8 +4,7 @@ def __init__(self, name: str) -> None: self.skills = [] def learn_skill(self, skill: str) -> None: - if skill not in self.skills: - self.skills.append(skill) + self.skills.append(skill) class FrontendDeveloper(SoftwareEngineer):