title: Find The Closest Number To Numbers Given In A List ~ Python
body: <p>How would you find the closest number in comparison to numbers given in a list?</p>
  <p>This is what I have tried so far, but it has been unsuccessful:</p>
  <pre><code>setted_list = [2, 9, 6, 20, 15]
  value_chosen = 17
  
  while True:
      final_value = setted_list[0]
      if setted_list[1] - value_chosen &lt; setted_list[0] - value_chosen:
          final_value = setted_list[1]
      if setted_list[2] - value_chosen &lt; setted_list[1] - value_chosen:
          final_value = setted_list[2]
      if setted_list[3] - value_chosen &lt; setted_list[2] - value_chosen:
          final_value = setted_list[3]
      if setted_list[4] - value_chosen &lt; setted_list[3] - value_chosen:
          final_value = setted_list[4]
  print(final_value)
  </code></pre>
  <p>My output is always what is inside the value of <code>setted_list[2]</code>.
  Where have I gone wrong in my algorithm?</p>