Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1unzip photos.zip | AA ZIP file must be unzipped (decompressed) first to get usable files back. Unzipping restores the originals exactly. | |
| 2decompress(song.mp3) | Boriginal == decompress(compress(original)) | |
| 3Lossless decompression gives back a file identical to the original | CJPG is lossy, so opening or decompressing it cannot restore the exact original. The removed detail is gone for good. | |
| 4A lossy file cannot be restored to the original after decompression | DTurns the MP3 back into playable sound, but the detail removed when it was made is not restored | |
| 5Open photo.jpg to get the exact original back | Eoriginal != decompress(compress_lossy(original)) | |
| 6A ZIP file must be used without unzipping | FDecompresses a ZIP archive so the original files are restored exactly, because ZIP is lossless |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
decompression — Reversing compression to turn a compressed file back into usable data. Only lossless decompression restores the exact original; lossy data that was removed is gone for good.import zipfile
z = zipfile.ZipFile("photos.zip")
z.extractall("photos")letter = "A"
count = 5
decoded = letter * countoriginal = "AAAABBB"
restored = decompress(compress(original))
print(original == restored)method = "lossless"
if method == "lossless":
print("Exact original restored")original = "AAAAABB"
packed = compress(original)
restored = decompress(packed)