Rebuilding the Sentence

Once you have a code string of numbers  1,0,1,1,2,3 etc.  You should be able to reverse your process to rebuild the sentence. 

This will involve reading each number in the code string in turn and fetching the word corresponding to that number from the unique word list. 

Create a string with the words back in the correct order. 

You can split the code string to a list if you like - split on comma or space depending on how you wrote it in the first place. 

Then step through the list of numbers with a for loop - take a number - get the word from that position in the unique words list - add that word to the new string you are creating. 

newsentence = newsentence +  [ word from the list

The sentence below can be rebuilt from the code string 0  1 2 1 0