from typing import Final lecture_time: Final[int] = 15 ects_effort: Final[int] = 30 class Lecture(): def __init__(self, name, ects, frequency): """ :param name: :param ects: :param frequency: """ self._name = name self._ects = ects self._frequency = frequency def cal_effort(self, time_per_ects = ects_effort, duration = lecture_time) -> float: """ Berechnet den Zeitaufwand pro woche für diese Vorlesung :param time_per_ects: :param duration: :return: """ effort_in_time = self._ects * time_per_ects effort_per_week = effort_in_time / duration return effort_per_week - (self._frequency * 1.5) def __repr__(self): return f"Vorlesungsname {self._name} ECTS: {self._ects}" # def __str__(self): # return self.__repr__() def parse_lecture_line(line: str) -> Lecture: words = line.split(";") words = [w.strip() for w in words] name = words[0] count = float(words[1]) ects = int(words[2]) return Lecture(name, ects, count) pass