Please write a program to compress and decompress the string "hello world!hello world!hello world!hello world!".


Topic: Please write a program to compress and decompress the string "hello world!hello world!hello world!hello world!".

Solution

import zlib
s = b'hello world!hello world!hello world!hello world!'
t = zlib.compress(s)
print(t)
print(zlib.decompress(t))



List all Python Programs