initial commit
This commit is contained in:
14
Python/OOP2/task2.py
Normal file
14
Python/OOP2/task2.py
Normal file
@ -0,0 +1,14 @@
|
||||
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)
|
Reference in New Issue
Block a user