We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
There was an error while loading. Please reload this page.
1 parent dba8eec commit 1567915Copy full SHA for 1567915
compression/Deflate.py
@@ -0,0 +1,18 @@
1
+import zlib
2
+
3
+# Data to compress
4
+data = b"Hello, DEFLATE! This is an example of data compression using the DEFLATE algorithm."
5
6
+# Compress the data using DEFLATE
7
+compressed_data = zlib.compress(data)
8
9
+# Decompress the data
10
+decompressed_data = zlib.decompress(compressed_data)
11
12
+# Output results
13
+print(f"Original Data: {data}")
14
+print(f"Compressed Data: {compressed_data}")
15
+print(f"Decompressed Data: {decompressed_data}")
16
17
+# Verify the decompressed data matches the original
18
+assert data == decompressed_data, "Decompressed data does not match the original data!"
0 commit comments