With the help of
zlib.compress(s) method, we can get compress the bytes of string by using
Return : Return compressed string.
Example #1 :
In this example we can see that by using
zlib.compress(s) method, we are able to compress the string in the byte format by using this method.
Example #2 :
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.