From 48a95ad35e735757dba8086702d82744db96e3f5 Mon Sep 17 00:00:00 2001 From: kkkkkkkkatya Date: Thu, 31 Oct 2024 13:15:38 +0200 Subject: [PATCH 1/4] solution --- app/main.py | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index fa56336e..6876942b 100644 --- a/app/main.py +++ b/app/main.py @@ -1 +1,57 @@ -# write your code here +from __future__ import annotations + + +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 = ["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 = ["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 = ["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) + self.skills = self.skills + FrontendDeveloper(name).skills + + 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 277bc312a244b66bcea01c87cbb9b9188c1841bb Mon Sep 17 00:00:00 2001 From: kkkkkkkkatya Date: Thu, 31 Oct 2024 13:22:06 +0200 Subject: [PATCH 2/4] solution 02 --- app/main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/main.py b/app/main.py index 6876942b..06d58464 100644 --- a/app/main.py +++ b/app/main.py @@ -48,8 +48,9 @@ def create_smooth_mobile_app(self) -> str: class FullStackDeveloper(BackendDeveloper, FrontendDeveloper): def __init__(self, name: str) -> None: - super().__init__(name) - self.skills = self.skills + FrontendDeveloper(name).skills + BackendDeveloper.__init__(self, name) + FrontendDeveloper.__init__(self, name) + self.skills = BackendDeveloper(name).skills + FrontendDeveloper(name).skills def create_web_application(self) -> None: print(f"{self.name} started creating a web application...") From aad82205eefc5a6dae7631a19656231390988a00 Mon Sep 17 00:00:00 2001 From: kkkkkkkkatya Date: Thu, 31 Oct 2024 13:23:32 +0200 Subject: [PATCH 3/4] solution 02 --- app/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index 06d58464..cac2fae1 100644 --- a/app/main.py +++ b/app/main.py @@ -50,7 +50,8 @@ class FullStackDeveloper(BackendDeveloper, FrontendDeveloper): def __init__(self, name: str) -> None: BackendDeveloper.__init__(self, name) FrontendDeveloper.__init__(self, name) - self.skills = BackendDeveloper(name).skills + FrontendDeveloper(name).skills + self.skills = (BackendDeveloper(name).skills + + FrontendDeveloper(name).skills) def create_web_application(self) -> None: print(f"{self.name} started creating a web application...") From 775d507baed0e17d8305fa3b854d4d0d5dcac705 Mon Sep 17 00:00:00 2001 From: kkkkkkkkatya Date: Thu, 31 Oct 2024 13:30:48 +0200 Subject: [PATCH 4/4] solution 03 --- app/main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/main.py b/app/main.py index cac2fae1..bd99ab35 100644 --- a/app/main.py +++ b/app/main.py @@ -50,8 +50,9 @@ class FullStackDeveloper(BackendDeveloper, FrontendDeveloper): def __init__(self, name: str) -> None: BackendDeveloper.__init__(self, name) FrontendDeveloper.__init__(self, name) - self.skills = (BackendDeveloper(name).skills + - FrontendDeveloper(name).skills) + self.back_skills = BackendDeveloper(name).skills + self.front_skills = FrontendDeveloper(name).skills + self.skills = self.back_skills + self.front_skills def create_web_application(self) -> None: print(f"{self.name} started creating a web application...")