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

lab 6 (lab 5 in python) #51

Open
wants to merge 2 commits into
base: Golosova_Anastasija_Sergeevna
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Вот сюда нужно будет в первой работе с гитом добавит свое ФИО

## ФИО
## Голосова Анастасия Сергеевна

## Работа с репозиторием

Expand Down
77 changes: 77 additions & 0 deletions python/src/fox.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
class Fox:
def __init__(self, name, age, gender):
self._name = name
self._gender = gender
self.set_age(age)
self._age = age

def get_name(self):
return self._name

def get_gender(self):
return self.gender

def get_age(self):
return self.age

def set_age(self, age):
if age >= 0 and age <=33:
self._age = age
else:
raise Exception('Foxes do not live that long')

def displayfox(self):
print("Name:", self._name, "\n"
"Age:", self._age, "\n"
"Gender:", self._gender, "\n"
"""
████ ████
▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓██
██▓▓▓▓▓▓▓▓██ ██▓▓▓▓▓▓▓▓██
██▓▓▓▓▓▓▓▓▓▓██ ██▓▓▓▓▓▓▓▓▓▓██
██▓▓▓▓▓▓▓▓▓▓██ ██▓▓▓▓▓▓▓▓▓▓██
██▓▓▓▓▓▓ ▓▓▓▓▓▓██ ██▓▓▓▓▓▓░░▓▓▓▓▓▓██
██▓▓▓▓▒▒ ▒▒▓▓▓▓██ ██▓▓▓▓▒▒ ▒▒▓▓▓▓██
██▓▓▓▓░░ ▓▓▓▓██ ██▓▓██ ▓▓▓▓██
██▓▓▓▓░░ ▓▓▓▓██ ██▓▓██ ▓▓▓▓██
██▓▓▓▓▓▓░░ ▓▓▓▓▓▓██ ██▓▓▓▓██ ▓▓▓▓▓▓██
██▓▓▓▓░░░░ ░░▓▓▓▓██ ██▓▓▓▓ ░░▓▓▓▓██
██▓▓▓▓░░░░ ░░▓▓▓▓▓▓██ ██▓▓▓▓▓▓░░ ░░░░▓▓▓▓██
██▓▓▓▓░░░░ ░░ ▓▓▓▓▓▓████████████████████████▓▓▓▓▓▓░░░░ ░░░░▓▓▓▓██
██▒▒▒▒░░░░░░ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░▒▒▒▒▒▒██▒▒▒▒▒▒▒▒░░▒▒░░░░▒▒▒▒██
██▒▒▒▒░░▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░▒▒░░▒▒▒▒██
██▒▒▒▒░░░░▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒ ░░▒▒▒▒██
██████▒▒▒▒ ▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒░░▒▒▒▒██████
██░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ██
██ ░░▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒░░ ██
██ ▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒ ██
██ ▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒ ██
██ ▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒ ██
████░░██░░▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒ ██ ████
██░░██░░ ▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒ ░░██ ██
██ ░░██ ▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒ ██ ██
██ ▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒ ██
██ ▒▒▒▒▒▒▒▒░░░░██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██░░░░▒▒▒▒▒▒▒▒ ██
██ ▒▒▒▒▒▒▒▒░░████░░░░░░░░░░░░░░░░░░░░░░░░░░░░████░░▒▒▒▒▒▒▒▒░░ ██
██░░ ▒▒▒▒▒▒▒▒██████░░░░░░░░░░░░░░░░░░░░░░░░██████▒▒▒▒▒▒▒▒ ██
██████████ ▒▒▒▒▒▒▒▒████░░░░░░░░░░░░░░░░░░░░░░░░████▒▒▒▒▒▒▒▒░░ ██████████
██ ░░ ██ ▒▒▒▒▒▒▒▒▒▒████░░░░░░░░░░░░░░░░░░░░████▒▒▒▒▒▒▒▒▒▒ ██ ░░██
██ ░░ ▒▒▒▒▒▒▒▒▒▒██▒▒▒▒░░░░░░░░░░░░▒▒▒▒██▒▒▒▒▒▒▒▒▒▒ ░░ ░░██
██████ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░▒▒▒▒░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ██████
████ ░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░▒▒░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▓▓██
████████ ▒▒▒▒▒▒▒▒▒▒▒▒░░░░▒▒▒▒░░░░▒▒▒▒▒▒▒▒▒▒▒▒ ████████
████░░▒▒▒▒▒▒▒▒▒▒░░▒▒▒▒▒▒▒▒░░▒▒▒▒▒▒▒▒▒▒░░████
██ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ██
██ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ██
██ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░██
██░░▒▒▒▒▓▓▒▒▒▒▓▓▒▒▒▒ ██
██ ▒▒▒▒▓▓▒▒▓▓▓▓▒▒▒▒ ██
██░░▒▒▓▓▓▓▓▓▓▓▒▒░░██
██ ████████ ██
▓▓ ████████ ██
▒▒▒▒▒▒░░▒▒▒▒██▒▒
░░██░░████
""")



14 changes: 9 additions & 5 deletions python/src/main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
def summ(a: int, b: int) -> int:
return a + b

import fox

if __name__ == "__main__":
print("Hello world")
print(summ(3, 4))
alissa = fox.Fox("Alissa", 0, "female")

try:
alissa.set_age(12)
except Exception as error:
print("Error:", error)

print(alissa.displayfox())