From a37e37fb737140a46c6527288a5405cada5b87d1 Mon Sep 17 00:00:00 2001 From: Misha Sanin <109426701+mikesanin@users.noreply.github.com> Date: Sun, 22 Oct 2023 16:04:50 +0300 Subject: [PATCH] Update main.py --- app/main.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/main.py b/app/main.py index 8fc787b5..480197db 100644 --- a/app/main.py +++ b/app/main.py @@ -1,15 +1,18 @@ +from typing import Dict + + class OnlineCourse: - def __init__(self, name, description, weeks): + def __init__(self, name: str, description: str, weeks: str): self.name = name self.description = description self.weeks = weeks @staticmethod - def days_to_weeks(days): + def days_to_weeks(days: int) -> int: return (days + 6) // 7 @classmethod - def from_dict(cls, course_dict): + def from_dict(cls, course_dict: Dict[str, str]) - "OnlineCourse": name = course_dict["name"] description = course_dict["description"] days = course_dict["days"]