From 09e3c6b26b0e80fd1fd55f76e8711210b2bb9d17 Mon Sep 17 00:00:00 2001 From: Davydova Olha Date: Mon, 14 Aug 2023 14:57:35 +0300 Subject: [PATCH 1/2] Implement Software Engineer classes --- app/main.py | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index fa56336e..e02888a8 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 = 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=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=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=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(BackendDeveloper, FrontendDeveloper): + def __init__(self, name: str) -> None: + super().__init__(name=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 7138505565a63bc1983adb5be9c08e397ed2d015 Mon Sep 17 00:00:00 2001 From: Davydova Olha Date: Mon, 14 Aug 2023 19:55:29 +0300 Subject: [PATCH 2/2] =?UTF-8?q?Code=20=D1=81leanup:=20minor=20adjustments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/main.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/main.py b/app/main.py index e02888a8..0e4557f0 100644 --- a/app/main.py +++ b/app/main.py @@ -4,7 +4,7 @@ def __init__(self, name: str) -> None: self.skills = [] def learn_skill(self, skill: str) -> None: - self. skills.append(skill) + self.skills.append(skill) class FrontendDeveloper(SoftwareEngineer): @@ -38,9 +38,6 @@ def create_smooth_mobile_app(self) -> str: class FullStackDeveloper(BackendDeveloper, FrontendDeveloper): - def __init__(self, name: str) -> None: - super().__init__(name=name) - def create_web_application(self) -> None: print(f"{self.name} started creating a web application...") self.create_powerful_api()