mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-23 21:11:08 +00:00
Compare commits
3 Commits
1f57975ba1
...
95b48d38d3
Author | SHA1 | Date | |
---|---|---|---|
|
95b48d38d3 | ||
|
f3f32ae3ca | ||
|
81fe9ed382 |
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue
Block a user