title: How to recreate a sentence from the list of unique words and the position
body: <p>I am creating a program which recreates a sentence from it's unique words and the positions of them. </p>
  
  <p>So far I have managed to collect the unique words and the positions of the original sentence.</p>
  
  <p>Here's what I have;</p>
  
  <pre><code>dictionary = {}#Creates an empty dictionary
  List=[]#Creates an empty list
  
  
  
  def play():
      unique = []
      sentence = "The fat cat, sat on the brick wall. The fat dog sat on the stone wall."#The original sentence
      splitted = sentence.split()
  
  
      for char in splitted:
          if char not in unique:#Finds the unique words
              unique.append(char)
  
      print(unique)#Prints the unique words
  
  
      for i,j in enumerate(splitted, 1):#puts i in each number next to each word, and j next to all the words in splitted
          if j in dictionary:#If the word is in dictionary
              List.append(dictionary[j])#The list will append the words position
          else:#Otherwise
              dictionary[j]=i#The dictionary will append the word and the number next to it
              List.append(i)#And then the list will take the number from it
  
      print(List)#Prints the Positions of the original sentence
  
  
  
  play()#Plays the main loop
  </code></pre>
  
  <p>What I am stuck on doing is finding a way of recreating the original sentence using the unique words and the positions of the original sentence. Any Ideas would be a great help. </p>
  
  <p>I am using Python 3.</p>