Skip to content

Commit c2bc6c1

Browse files
committed
added doctest to huffman.py
1 parent 7e54b91 commit c2bc6c1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compression/huffman.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def parse_file(file_path: str) -> list[Letter]:
2626
frequencies, then convert the dict into a list of Letters.
2727
2828
>>> file_path = 'file_to_read.txt'
29-
>>> print(open(file_path, 'r').read()) # showing user content of file
29+
>>> print(open(file_path, 'r').read()) # showing content of file
3030
This is the text contained in the file
3131
>>> parse_file(file_path)
3232
[T:1, x:1, c:1, o:1, a:1, d:1, f:1, l:1, s:2, h:3, n:3, i:5, t:5, e:5, :7]
@@ -92,7 +92,7 @@ def huffman(file_path: str) -> None:
9292
bitstring for each letter.
9393
9494
>>> file_path = 'file_to_read.txt'
95-
>>> print(open(file_path, 'r').read()) # showing user content of file
95+
>>> print(open(file_path, 'r').read()) # showing content of file
9696
This is the text contained in the file
9797
>>> huffman(file_path)
9898
Huffman Coding of file_to_read.txt:

0 commit comments

Comments
 (0)