From ef1d164c2fb8393db3cf34dbf5de6a88558dccf6 Mon Sep 17 00:00:00 2001 From: Sonya Savkova Date: Tue, 8 Oct 2024 16:34:53 +0300 Subject: [PATCH 1/2] Solution --- app/main.py | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index fa56336e..0015857f 100644 --- a/app/main.py +++ b/app/main.py @@ -1 +1,47 @@ -# write your code here +class SoftwareEngineer: + def __init__(self, name: str) -> None: + self.name: str = name + self.skills: list[str] = [] + + def learn_skill(self, skill: str) -> None: + 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(["Python", "SQL", "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 __init__(self, name: str) -> None: + super().__init__(name) + + 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 85fed99e5822d51a33cb8a085079ca7964630510 Mon Sep 17 00:00:00 2001 From: Sonya Savkova Date: Tue, 8 Oct 2024 18:15:16 +0300 Subject: [PATCH 2/2] Solution --- app/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/main.py b/app/main.py index 0015857f..2a9e45f5 100644 --- a/app/main.py +++ b/app/main.py @@ -10,7 +10,7 @@ def learn_skill(self, skill: str) -> None: class FrontendDeveloper(SoftwareEngineer): def __init__(self, name: str) -> None: super().__init__(name) - self.skills.extend(["JavaScript", "HTML", "CSS"]) + self.skills += ["JavaScript", "HTML", "CSS"] def create_awesome_web_page(self) -> str: print(f"{self.name} is creating a webpage...") @@ -20,7 +20,7 @@ def create_awesome_web_page(self) -> str: class BackendDeveloper(SoftwareEngineer): def __init__(self, name: str) -> None: super().__init__(name) - self.skills.extend(["Python", "SQL", "Django"]) + self.skills += ["Python", "SQL", "Django"] def create_powerful_api(self) -> str: print(f"{self.name} is creating an API...") @@ -30,7 +30,7 @@ def create_powerful_api(self) -> str: class AndroidDeveloper(SoftwareEngineer): def __init__(self, name: str) -> None: super().__init__(name) - self.skills.extend(["Java", "Android studio"]) + self.skills += ["Java", "Android studio"] def create_smooth_mobile_app(self) -> str: print(f"{self.name} is creating a mobile app...")