Implementing simple compression program with Python3