Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> ================================ RESTART ================================ >>> >>> inter1 ['a', 'b', 'c', 'd', [4, 3]] >>> bits '01100001011000100110001101100100100000000010000011' >>> 4*8 + 1*18 50 >>> len(bits) 50 >>> inters Traceback (most recent call last): File "", line 1, in inters NameError: name 'inters' is not defined >>> inter2 ['a', 'b', 'c', 'd', [4, 3]] >>> text2 'abcdabc' >>> [bits[8*i:8*(i+1)] for i in range(4)] ['01100001', '01100010', '01100011', '01100100'] >>> [(bits[8*i], bits[8*i+1:8*(i+1))] for i in range(4)] SyntaxError: invalid syntax >>> [(bits[8*i], bits[8*i+1:8*(i+1)] for i in range(4)] SyntaxError: invalid syntax >>> [(bits[8*i], bits[8*i+1:8*(i+1]) for i in range(4)] SyntaxError: invalid syntax >>> [(bits[8*i], bits[8*i+1:8*(i+1)]) for i in range(4)] [('0', '1100001'), ('0', '1100010'), ('0', '1100011'), ('0', '1100100')] >>> [bin(ord(c))[2:] for c in "abcd"] ['1100001', '1100010', '1100011', '1100100'] >>> bits[32], bits[33:45], bits[45] ('1', '000000000100', '0') >>> bits[32], bits[33:45], bits[45:] ('1', '000000000100', '00011') >>> inter1, bits, inter2, text2 = process("xyzxyzwxyzw") >>> inter1 ['x', 'y', 'z', [3, 3], 'w', [4, 4]] >>> lz_ratio("a"*100) 0.11428571428571428 >>> 18/31/7 0.08294930875576037 >>> lz_ratio("a"*1000) 0.086 >>> lz_ratio("a"*10000) 0.08317142857142858 >>> compare_lz_huffman(rand) Huffman compression ratio: 0.9891428571428571 LZ compression ratio: 1.1428571428571428 >>> 8/7 1.1428571428571428 >>> compare_lz_huffman(s) Huffman compression ratio: 0.6385836385836385 LZ compression ratio: 0.2629222629222629 >>> Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> ================================ RESTART ================================ >>> >>> image2bitmap("amir.jpg") >>> im.display() >>> ================================ RESTART ================================ >>> >>> im.display() >>> add(im,100).display() >>> what(im).display() >>> negate(im).display() >>> shift(im, 100).display() >>> ================================ RESTART ================================ >>> >>> shift(im, 100).display() >>> ================================ RESTART ================================ >>> >>> shift(im, 100).display() >>>