Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
timovlad authored Nov 13, 2024
1 parent aa44f23 commit 04fc230
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,12 @@ def __init__(self, name: str, description: str, weeks: int) -> None:
self.name = name
self.description = description
self.weeks = weeks

# course = OnlineCourse(
# name="Python Basics",
# description="The best course to start learning Python",
# weeks=2,
# )
# print(course.description) # The best course to start learn Python
@staticmethod
def days_to_weeks(days: int) -> int:
return (days + 6) // 7

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

0 comments on commit 04fc230

Please sign in to comment.