Skip to content

Commit 5df16f1

Browse files
authored
Add doctest to hashes/hamming_code.py (TheAlgorithms#10961)
1 parent 0eb1825 commit 5df16f1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

hashes/hamming_code.py

+4
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ def emitter_converter(size_par, data):
7777
7878
>>> emitter_converter(4, "101010111111")
7979
['1', '1', '1', '1', '0', '1', '0', '0', '1', '0', '1', '1', '1', '1', '1', '1']
80+
>>> emitter_converter(5, "101010111111")
81+
Traceback (most recent call last):
82+
...
83+
ValueError: size of parity don't match with size of data
8084
"""
8185
if size_par + len(data) <= 2**size_par - (len(data) - 1):
8286
raise ValueError("size of parity don't match with size of data")

0 commit comments

Comments
 (0)