VOOZH about

URL: https://www.geeksforgeeks.org/python/zlib-compresss-in-python/

⇱ zlib.compress(s) in python - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

zlib.compress(s) in python

Last Updated : 6 Mar, 2020
With the help of zlib.compress(s) method, we can get compress the bytes of string by using zlib.compress(s) method.
Syntax : zlib.compress(string) 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. Output :
43 49
Example #2 :
Output :
22 27
Comment
Article Tags: