initial commit
This commit is contained in:
14
Python/OOP2/task5.py
Normal file
14
Python/OOP2/task5.py
Normal file
@ -0,0 +1,14 @@
|
||||
from dataclasses import dataclass
|
||||
from typing import Self
|
||||
|
||||
|
||||
@dataclass
|
||||
class Person:
|
||||
name: str
|
||||
age: int
|
||||
|
||||
def move(self: Self) -> None:
|
||||
print(f"{self.name} говорит")
|
||||
|
||||
def talk(self: Self) -> None:
|
||||
print(f"{self.name} идёт")
|
Reference in New Issue
Block a user