title: How to replace string front back in python
body: <p>Given a string, return a new string where the first and last chars have been exchanged.</p>
  
  <pre><code>front_back('code') → 'eodc'
  front_back('a') → 'a'
  front_back('ab') → 'ba'
  </code></pre>
  
  <p>How can i solve this?</p>