import sys

print("Pipeline de réception prêt")
print("Version :", sys.version_info.major, sys.version_info.minor)
assert sys.version_info.major == 3


texte = "ETL"
octets = texte.encode("utf-8")
binaire = " ".join(f"{octet:08b}" for octet in octets)
assert binaire == "01000101 01010100 01001100"
assert bytes(int(groupe, 2) for groupe in binaire.split()).decode("utf-8") == texte


assert 7 + 2 == 9 and 7 - 2 == 5 and 7 * 2 == 14
assert 7 / 2 == 3.5 and 7 // 2 == 3

from types import CodeType

expression_fixe = "quantite * 2"
code_calcule = compile(expression_fixe, "<exemple-lot>", "eval")
assert isinstance(code_calcule, CodeType)
assert eval(code_calcule, {"quantite": 3}) == 6
assert eval(code_calcule, {"quantite": 5}) == 10
