Skip to content

Commit 13378dd

Browse files
authored
Add doctests for is_trimorphic function
Added doctests for the is_trimorphic function to validate its behavior with various inputs, including edge cases.
1 parent fe7f974 commit 13378dd

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

trimorphic_number.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,29 @@
99
def is_trimorphic(number: int) -> bool:
1010
"""
1111
Checks if a number is a Trimorphic number.
12+
13+
>>> is_trimorphic(0)
14+
True
15+
>>> is_trimorphic(1)
16+
True
17+
>>> is_trimorphic(4)
18+
True
19+
>>> is_trimorphic(5)
20+
True
21+
>>> is_trimorphic(24)
22+
True
23+
>>> is_trimorphic(249)
24+
True
25+
>>> is_trimorphic(2)
26+
False
27+
>>> is_trimorphic(7)
28+
False
29+
>>> is_trimorphic(10)
30+
False
31+
>>> is_trimorphic(-1)
32+
Traceback (most recent call last):
33+
...
34+
ValueError: Input must be a non-negative integer
1235
"""
1336
if number < 0:
1437
raise ValueError("Input must be a non-negative integer")

0 commit comments

Comments
 (0)