From aac8e0faefb6856195a641cd9447d676b08adb71 Mon Sep 17 00:00:00 2001 From: AndreyShevchenkoDevil Date: Sun, 25 Aug 2024 22:58:03 +0200 Subject: [PATCH 1/2] 'Solution' --- app/main.py | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index fa56336e..ff780998 100644 --- a/app/main.py +++ b/app/main.py @@ -1 +1,49 @@ -# write your code here +class SoftwareEngineer: + def __init__(self, name: str) -> None: + self.name = name + self.skills = [] + + def learn_skill(self, skill: str) -> None: + self.skills.append(skill) + + +class FrontendDeveloper(SoftwareEngineer): + def __init__(self, name: str) -> None: + super().__init__(name) + self.learn_skill("JavaScript") + self.learn_skill("HTML") + self.learn_skill("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.learn_skill("Python") + self.learn_skill("SQL") + self.learn_skill("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.learn_skill("Java") + self.learn_skill("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(BackendDeveloper, FrontendDeveloper): + def create_web_application(self) -> None: + print(f"{self.name} started creating a web application...") + self.create_powerful_api() + self.create_awesome_web_page() From 2d6f164020e966a53c950be9822a984bc86f51e8 Mon Sep 17 00:00:00 2001 From: AndreyShevchenkoDevil Date: Mon, 26 Aug 2024 16:17:24 +0200 Subject: [PATCH 2/2] 'Solution' --- app/main.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/app/main.py b/app/main.py index ff780998..f5913700 100644 --- a/app/main.py +++ b/app/main.py @@ -10,9 +10,7 @@ def learn_skill(self, skill: str) -> None: class FrontendDeveloper(SoftwareEngineer): def __init__(self, name: str) -> None: super().__init__(name) - self.learn_skill("JavaScript") - self.learn_skill("HTML") - self.learn_skill("CSS") + self.skills.extend(["JavaScript", "HTML", "CSS"]) def create_awesome_web_page(self) -> str: print(f"{self.name} is creating a webpage...") @@ -22,9 +20,7 @@ def create_awesome_web_page(self) -> str: class BackendDeveloper(SoftwareEngineer): def __init__(self, name: str) -> None: super().__init__(name) - self.learn_skill("Python") - self.learn_skill("SQL") - self.learn_skill("Django") + self.skills.extend(["Python", "SQL", "Django"]) def create_powerful_api(self) -> str: print(f"{self.name} is creating an API...") @@ -34,8 +30,7 @@ def create_powerful_api(self) -> str: class AndroidDeveloper(SoftwareEngineer): def __init__(self, name: str) -> None: super().__init__(name) - self.learn_skill("Java") - self.learn_skill("Android studio") + self.skills.extend(["Java", "Android studio"]) def create_smooth_mobile_app(self) -> str: print(f"{self.name} is creating a mobile app...")