title: To reverse sentence in python
body: <p>Thank you for all the answers. I got why my code is wrong.</p>
  
  <p>Please don't provide me with solutions because I do have a few but then I want to understand my code is not working.</p>
  
  <p>I think it is due to <code>while x &lt;= -len(split_result):"</code> but then the I think the logic is correct. What is wrong with my code?</p>
  
  <pre><code>O_string = ("Me name is Mr_T")
  split_result = O_string.split()
  print(split_result)
  
  x=0
  list=[]
  
  while x &lt;= -len(split_result):
      list.append(split_result[x-1])
      x = x-1
  
  result=" ".join(list)
  print (result)
  </code></pre>