Skip to content

Commit

Permalink
Solution
Browse files Browse the repository at this point in the history
  • Loading branch information
zaebalsya1 committed Dec 18, 2024
1 parent 8ac761e commit 2445950
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
class OnlineCourse:
# write your code here
pass
def __init__(self, name: str, description: str, weeks: int) -> None:
self.name = name
self.description = description
self.weeks = weeks

@staticmethod
def days_to_weeks(days: int) -> int:
return (days + 6) // 7

@classmethod
def from_dict(cls, course_dict: dict) -> "OnlineCourse":
name = course_dict["name"]
description = course_dict["description"]
weeks = cls.days_to_weeks(course_dict["days"])
return cls(name, description, weeks)

0 comments on commit 2445950

Please sign in to comment.