title: How to swap Character of string with the given condition?
body: <pre><code>def password(passlist):
  
      listt = []
      for i in range(0, len(passlist)):
          temp = passlist[i]
  
      for j in range(0, len(temp)/2):
          if((j+2)%2 == 0) :
                  t = temp[j]
                  temp.replace(temp[j], temp[j+2])
                  temp.replace(temp[j+2], t)  
      listt.append(temp)
  </code></pre>
  
  <p>I am passing a list of string
  example <code>["abcd", "bcad"]</code>. for each string <code>i</code> will swap <code>i</code>th character with <code>j</code> character if <code>(i+j)%2 == 0</code>.
  My code is going out of the boundary of string.
  Please suggest me a better approach to this problem</p>