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

25 задача (Федя) #14

Open
Zener085 opened this issue Dec 5, 2022 · 0 comments
Open

25 задача (Федя) #14

Zener085 opened this issue Dec 5, 2022 · 0 comments
Assignees

Comments

@Zener085
Copy link
Contributor

Zener085 commented Dec 5, 2022

На уроке мы не доделали код для 25 задачи из варианта
Сам код:

def find_even_divs(number: int) -> int:
    found = 2

    if not (number / 2) % 2:
        found += 1

    for div in range(3, int(number ** 0.5)):
        if number % div and not div % 2:
            found += 1

        if not (number / div) % 2:
            found += 1

    if not (number % int(number ** 0.5))

    return found


print(find_even_divs(12))
print(find_even_divs(1024))
print(find_even_divs(24))


for i in range(101_000_000, 102_000_001, 2):
    if find_even_divs(i) == 3:
        print(i)

Этот код работает не корректно, так как неправильно выводит ответ для 3 "тестов". Твоя задача - подправить это и получить правильный ответ для задачи.

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

No branches or pull requests

2 participants