Python 3 Compress String