title: Assigning number to word in a string in python
body: <p>hi i have a compression task in python to develop code where if the input is </p>
  
  <p><code>'hello its me, hello can you hear me, hello are you listening'</code></p>
  
  <p>Then the output should be </p>
  
  <p><code>1,2,3,1,4,5,6,3,1,7,5,8</code></p>
  
  <p>Basically each word is assigned a numerical value and if the word is repeated so is the word.
  This coding is in python, please help me thank you </p>