title: How to replace specific string in the list in python
body: <p>I wrote down the code to generate ['---', '---', '---'] below: </p>
  
  <pre><code>ans = []
  for i in range(top, bottom):
      ans.append("-"*3)
  </code></pre>
  
  <p>If I would like to change first '-' in the first string and last '-' in the last string into '*', how to complete code below? :)</p>
  
  <p>desired output would be:</p>
  
  <pre><code>['*--', '---', '--*']
  </code></pre>
  
  <p>by adding lines below the code.</p>