A simple yet educational encoding algorithm for Python applications