mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-06 10:31:29 +08:00
Enable ruff SIM102 rule (#11341)
* Enable ruff SIM102 rule * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@ -85,9 +85,10 @@ def validate(n: int) -> bool:
|
||||
>>> validate(3797)
|
||||
True
|
||||
"""
|
||||
if len(str(n)) > 3:
|
||||
if not is_prime(int(str(n)[-3:])) or not is_prime(int(str(n)[:3])):
|
||||
return False
|
||||
if len(str(n)) > 3 and (
|
||||
not is_prime(int(str(n)[-3:])) or not is_prime(int(str(n)[:3]))
|
||||
):
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user