mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-23 21:11:08 +00:00
Add doctest to hashes/hamming_code.py (#10961)
This commit is contained in:
parent
0eb1825af2
commit
5df16f11eb
|
@ -77,6 +77,10 @@ def emitter_converter(size_par, data):
|
|||
|
||||
>>> emitter_converter(4, "101010111111")
|
||||
['1', '1', '1', '1', '0', '1', '0', '0', '1', '0', '1', '1', '1', '1', '1', '1']
|
||||
>>> emitter_converter(5, "101010111111")
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
ValueError: size of parity don't match with size of data
|
||||
"""
|
||||
if size_par + len(data) <= 2**size_par - (len(data) - 1):
|
||||
raise ValueError("size of parity don't match with size of data")
|
||||
|
|
Loading…
Reference in New Issue
Block a user