title: Wave mechanism in python
body: <p>I tried to apply wave to my assigned word. But I faced with the situation that it is needed to handle duplicate characters. Can someone helps me for this case?</p>
  <pre><code>def wave(people):
      return [people.replace(people[i], people[i].upper()) for i in range(len(people))]
  
  wave(&quot;letter&quot;)
  </code></pre>
  <p><em>Output:</em></p>
  <blockquote>
  <p>['Letter', 'lEttEr', 'leTTer', 'leTTer', 'lEttEr', 'letteR']</p>
  </blockquote>
  <p><em>Real output should be:</em></p>
  <blockquote>
  <p>['Letter', 'lEtter', 'leTter', 'letTer', 'lettEr', 'letteR']</p>
  </blockquote>