mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 01:09:40 +08:00
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:
@ -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__":
|
||||
|
Reference in New Issue
Block a user