Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesanin authored Oct 22, 2023
1 parent d984520 commit a37e37f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -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"]
Expand Down

0 comments on commit a37e37f

Please sign in to comment.