refactor: Move constants outside of variable scope (#7262)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
This commit is contained in:
Caeden
2022-10-16 10:33:29 +01:00
committed by GitHub
parent 7776411621
commit c6582b35bf
17 changed files with 107 additions and 97 deletions

View File

@ -34,9 +34,9 @@ def solution(n: int = 10) -> str:
"""
if not isinstance(n, int) or n < 0:
raise ValueError("Invalid input")
MODULUS = 10**n # noqa: N806
NUMBER = 28433 * (pow(2, 7830457, MODULUS)) + 1 # noqa: N806
return str(NUMBER % MODULUS)
modulus = 10**n
number = 28433 * (pow(2, 7830457, modulus)) + 1
return str(number % modulus)
if __name__ == "__main__":