Encoding/Decoding Python Program