
Quiz
Base64 Is an Envelope
Some places can only carry plain letters and digits, not raw bytes.
Base64 solves this. It rewrites any bytes using just 64 safe
characters (A–Z, a–z, 0–9, + and /). You'll see it
in emails, web pages and data files.
To use a tool from Python's standard library, import it first.
Think of import as fetching a tool from the shed.
import base64
packed = base64.b64encode("pip".encode("utf-8"))
print(packed) # b'cGlw'
print(base64.b64decode(packed)) # b'pip'