Compare commits

...

3 Commits

Author SHA1 Message Date
Scarfinos
95b48d38d3
Merge 81fe9ed382 into f3f32ae3ca 2024-11-20 11:23:45 +01:00
pre-commit-ci[bot]
f3f32ae3ca
[pre-commit.ci] pre-commit autoupdate (#12385)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.7.3 → v0.7.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.7.3...v0.7.4)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-11-18 22:07:12 +01:00
Scarfinos
81fe9ed382 #9943 : improve coverrage test for armstrong number 2024-10-30 10:29:14 +01:00
2 changed files with 5 additions and 5 deletions

View File

@ -16,7 +16,7 @@ repos:
- id: auto-walrus
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.3
rev: v0.7.4
hooks:
- id: ruff
- id: ruff-format

View File

@ -43,9 +43,9 @@ def armstrong_number(n: int) -> bool:
def pluperfect_number(n: int) -> bool:
"""Return True if n is a pluperfect number or False if it is not
>>> all(armstrong_number(n) for n in PASSING)
>>> all(pluperfect_number(n) for n in PASSING)
True
>>> any(armstrong_number(n) for n in FAILING)
>>> any(pluperfect_number(n) for n in FAILING)
False
"""
if not isinstance(n, int) or n < 1:
@ -70,9 +70,9 @@ def pluperfect_number(n: int) -> bool:
def narcissistic_number(n: int) -> bool:
"""Return True if n is a narcissistic number or False if it is not.
>>> all(armstrong_number(n) for n in PASSING)
>>> all(narcissistic_number(n) for n in PASSING)
True
>>> any(armstrong_number(n) for n in FAILING)
>>> any(narcissistic_number(n) for n in FAILING)
False
"""
if not isinstance(n, int) or n < 1: