Skip to content

Commit e4ae0f8

Browse files
committed
Improve coverage hamming_numbers
1 parent fc33c50 commit e4ae0f8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

maths/special_numbers/hamming_numbers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ def hamming(n_element: int) -> list:
1313
:param n_element: The number of elements on the list
1414
:return: The nth element of the list
1515
16+
>>> hamming(-5)
17+
Traceback (most recent call last):
18+
...
19+
ValueError: a should be a positive number
1620
>>> hamming(5)
1721
[1, 2, 3, 4, 5]
1822
>>> hamming(10)

0 commit comments

Comments
 (0)