1 2 3 4 5 6 7 8 9 10 output from huffman.py 1 01000 2 01001 3 0101 4 1100 5 1101 6 011 7 100 8 101 9 111 10 00 and from huffman.p codewords: 1 0.01818 5.8 5 00000 2 0.03636 4.8 5 00001 3 0.05455 4.2 4 0001 4 0.07273 3.8 4 1000 5 0.09091 3.5 4 1001 6 0.1091 3.2 3 001 7 0.1273 3.0 3 110 8 0.1455 2.8 3 111 9 0.1636 2.6 3 101 10 0.1818 2.5 2 01 huffman7.py is the best standalone program with built in counts. huffman10.py is one that reads from standard input.