diff --git a/app/main.py b/app/main.py index fa56336e..8f2a4377 100644 --- a/app/main.py +++ b/app/main.py @@ -1 +1,57 @@ -# write your code here +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): + front_dev_skill = ["JavaScript", "HTML", "CSS"] + + def __init__(self, name: str) -> None: + super().__init__(name) + for skill in FrontendDeveloper.front_dev_skill: + self.learn_skill(skill) + + def create_awesome_web_page(self) -> str: + print(f"{self.name} is creating a webpage...") + return "

Hello world

" + + +class BackendDeveloper(SoftwareEngineer): + backend_dev_skills = ["Python", "SQL", "Django"] + + def __init__(self, name: str) -> None: + super().__init__(name) + for skill in BackendDeveloper.backend_dev_skills: + self.learn_skill(skill) + + 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.learn_skill("Java") + self.learn_skill("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) + for skill in FrontendDeveloper.front_dev_skill: + self.learn_skill(skill) + + def create_web_application(self) -> None: + print(f"{self.name} started creating a web application...") + self.create_powerful_api() + self.create_awesome_web_page()