Spaces:
Sleeping
Sleeping
File size: 595 Bytes
d2213a5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | """Модель задачи"""
from typing import List, Dict, Any
from dataclasses import dataclass, asdict
@dataclass
class Task:
"""Модель задачи по теории вероятности"""
type: str
question: str
answer: float
answer_fraction: str
solution: str
steps: List[str]
complexity: str = 'medium'
def to_dict(self) -> Dict[str, Any]:
"""
Конвертация в словарь
Возвращает:
dict: словарь с данными задачи
"""
return asdict(self) |