Skip to content

Comments

Кузьмищев Леонид Сергеевич 25Б-42#15

Draft
leonilkuz-13 wants to merge 9 commits intopython-course-matmex:mainfrom
leonilkuz-13:test_branch
Draft

Кузьмищев Леонид Сергеевич 25Б-42#15
leonilkuz-13 wants to merge 9 commits intopython-course-matmex:mainfrom
leonilkuz-13:test_branch

Conversation

@leonilkuz-13
Copy link

The checksum was fixed, errors in binary search were added. Tests were written for 2 files. A README was added. A console utility was written for checksum

@leonilkuz-13 leonilkuz-13 marked this pull request as draft November 7, 2025 14:26
@leonilkuz-13 leonilkuz-13 marked this pull request as ready for review November 7, 2025 14:37
@leonilkuz-13 leonilkuz-13 marked this pull request as draft November 7, 2025 14:49
@leonilkuz-13
Copy link
Author

/request-review @chernishev

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: 7/10
Бинарный поиск: 5/5
Оформление: 8/10 (нет лицензии, .gitignore)

Comment on lines +27 to +39
print("Exit - -1")
print("To enter, enter any number")
string = input()
while True:
print("enter ISBN_number or came out")
if string == "-1":
print("you came out")
break
string = input()
if modulo11_checksum(string):
print("correct")
else:
print("incorrect")
Copy link

Choose a reason for hiding this comment

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

Когда pytest импортирует этот файл для тестов, он зависнет, ожидая ввода данных.
Код, который относится к запуску нужно оборачивать в if __name__ == "__main__".

Comment on lines +14 to +15
if digits is None:
return False
Copy link

Choose a reason for hiding this comment

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

Рекомендация: при неверной длине строки (или других ошибках) лучше выбрасывать исключение, чтобы различать некорректный формат входных данных и просто невалидную контрольную сумму.
Тогда в вызывающем коде нужно будет добавить блок try-except.

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