Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

from go to py #43

Open
wants to merge 1 commit into
base: Serunin_Denis_Vitalevich
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Algorithm_2024
Submodule Algorithm_2024 added at 633902
14 changes: 14 additions & 0 deletions python/lab5/lab5.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class Game_Character():

def __init__(self, nickname: str, level: int, rang: str):
self.rang = rang
self.level = level
self.nickname = nickname
self.Rules()

def Rules(self):
if not isinstance(self.nickname, str):
raise TypeError("Неверный тип данных name")
if self.level < 0:
raise ValueError("Выйди и удали игру")
print(f"Успешное создание персонажа!\nНик: {self.nickname}\nУровень: {self.level}\nРанг: {self.rang}")
6 changes: 6 additions & 0 deletions python/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import lab5.lab5 as lab5t

try1 = lab5t.Game_Character("Evestal", 2, "archer")

try2 = lab5t.Game_Character("MarbleTheFox", 8, "warrior")