This repository has been archived on 2024-08-23. You can view files and clone it, but cannot push or open issues or pull requests.
lessons/Python/OOP2/task2.py
2023-07-16 13:23:25 +00:00

15 lines
240 B
Python

from dataclasses import dataclass
from typing import Self
@dataclass
class Foo:
a: int
b: int
def sum(self: Self) -> int:
return self.a + self.b
def greater(self: Self) -> int:
return max(self.a, self.b)