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

@@ -13,6 +13,8 @@ Find the sum of all the numbers less than 10^8 that are both palindromic and can
be written as the sum of consecutive squares.
"""
LIMIT = 10**8
def is_palindrome(n: int) -> bool:
"""
@@ -35,7 +37,6 @@ def solution() -> int:
Returns the sum of all numbers less than 1e8 that are both palindromic and
can be written as the sum of consecutive squares.
"""
LIMIT = 10**8 # noqa: N806
answer = set()
first_square = 1
sum_squares = 5