From 357393f15dde55dbfccea4277c379ede06d5a5ac Mon Sep 17 00:00:00 2001 From: Viktoria Kalinina Date: Thu, 19 Sep 2024 22:08:38 +0200 Subject: [PATCH] Solution --- app/main.py | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index fa56336e..9bd17d21 100644 --- a/app/main.py +++ b/app/main.py @@ -1 +1,58 @@ -# write your code here +class SoftwareEngineer: + skills = [] + + def __init__(self, name: str) -> None: + self.name = name + + @classmethod + def learn_skill(cls, skill: str) -> None: + return cls.skills.append(skill) + + +class FrontendDeveloper(SoftwareEngineer): + skills = ["JavaScript", "HTML", "CSS"] + + def __init__(self, name: str) -> None: + super().__init__(name) + + def create_awesome_web_page(self) -> str: + print(f"{self.name} is creating a webpage...") + return "

Hello world

" + + +class BackendDeveloper(SoftwareEngineer): + skills = ["Python", "SQL", "Django"] + + def __init__(self, name: str) -> None: + super().__init__(name) + + def create_powerful_api(self) -> str: + print(f"{self.name} is creating an API...") + return "http://127.0.0.1:8000" + + +class AndroidDeveloper(SoftwareEngineer): + skills = ["Java", "Android studio"] + + def __init__(self, name: str) -> None: + super().__init__(name) + + 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, + SoftwareEngineer +): + skills = BackendDeveloper.skills + FrontendDeveloper.skills + + 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()