Skip to content

Comments

Контрольная работа. Группа 25Б42. Разгуляева Ада Игоревна#11

Open
ada1ra wants to merge 19 commits intopython-course-matmex:mainfrom
ada1ra:ada1ra_branch
Open

Контрольная работа. Группа 25Б42. Разгуляева Ада Игоревна#11
ada1ra wants to merge 19 commits intopython-course-matmex:mainfrom
ada1ra:ada1ra_branch

Conversation

@ada1ra
Copy link

@ada1ra ada1ra commented Nov 7, 2025

No description provided.

Copy link

@Godrik0 Godrik0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ISBN10: 8/10
Бинарный поиск: 2/5
Оформление: 9/10 (нет описания к PR)

Comment on lines +9 to +10
if xs != sorted(xs):
raise ValueError("Список должен быть отсортирован")
Copy link

@Godrik0 Godrik0 Dec 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Бинарный поиск должен работать за $O(\log{N})$, добавляя в проверку сортировку он начинает работать за $O(N \log{N})$.

Comment on lines +10 to +23
def test_with_x():
assert modulo_11_checksum("0-9752298-0-X")

def test_non_string():
with pytest.raises(TypeError):
modulo_11_checksum(123)

def test_short_string():
with pytest.raises(ValueError):
modulo_11_checksum("123")

def test_x_in_wrong_position():
with pytest.raises(ValueError):
modulo_11_checksum("X306406152")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ваш код в функции modulo_11_checksum обернут в конструкцию try-except, которая перехватит все возникшие ошибки и вернет False.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants