Compare commits

...

2 Commits

Author SHA1 Message Date
Scarfinos
2b6c79a06b
Merge 81fe9ed382 into 3e9ca92ca9 2024-11-05 11:32:52 +01:00
Scarfinos
81fe9ed382 #9943 : improve coverrage test for armstrong number 2024-10-30 10:29:14 +01:00

View File

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