From 5710320ed128d67aa66455dbe681f130e67f2045 Mon Sep 17 00:00:00 2001 From: Artem Date: Sun, 3 Sep 2023 16:55:12 +0200 Subject: [PATCH 1/3] Solution --- app/main.py | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index fa56336e..fa7780fe 100644 --- a/app/main.py +++ b/app/main.py @@ -1 +1,50 @@ -# 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.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 = ["Python", "SQL", "Django", "JavaScript", "HTML", "CSS"] + + 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 af27796af5ce95743731a78157119f9c25ded231 Mon Sep 17 00:00:00 2001 From: Artem Date: Sun, 3 Sep 2023 20:12:00 +0200 Subject: [PATCH 2/3] Solution --- app/main.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/main.py b/app/main.py index fa7780fe..19b242b3 100644 --- a/app/main.py +++ b/app/main.py @@ -9,10 +9,9 @@ def learn_skill(self, skill: str) -> None: class FrontendDeveloper(SoftwareEngineer): - def __init__(self, name: str) -> None: super().__init__(name) - self.skills = ["JavaScript", "HTML", "CSS"] + self.skills += ["JavaScript", "HTML", "CSS"] def create_awesome_web_page(self) -> str: print(f"{self.name} is creating a webpage...") @@ -22,7 +21,7 @@ def create_awesome_web_page(self) -> str: class BackendDeveloper(SoftwareEngineer): def __init__(self, name: str) -> None: super().__init__(name) - self.skills = ["Python", "SQL", "Django"] + self.skills += ["Python", "SQL", "Django"] def create_powerful_api(self) -> str: print(f"{self.name} is creating an API...") @@ -40,9 +39,6 @@ def create_smooth_mobile_app(self) -> str: class FullStackDeveloper(BackendDeveloper, FrontendDeveloper): - def __init__(self, name: str) -> None: - super().__init__(name) - self.skills = ["Python", "SQL", "Django", "JavaScript", "HTML", "CSS"] def create_web_application(self) -> None: print(f"{self.name} started creating a web application...") From dbbc7d39700da085c02431a4d3d98b4205a9e4df Mon Sep 17 00:00:00 2001 From: Artem Date: Mon, 4 Sep 2023 11:09:49 +0200 Subject: [PATCH 3/3] Solution --- app/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index 19b242b3..53395a67 100644 --- a/app/main.py +++ b/app/main.py @@ -31,7 +31,7 @@ def create_powerful_api(self) -> str: class AndroidDeveloper(SoftwareEngineer): def __init__(self, name: str) -> None: super().__init__(name) - self.skills = ["Java", "Android studio"] + self.skills += ["Java", "Android studio"] def create_smooth_mobile_app(self) -> str: print(f"{self.name} is creating a mobile app...")