title: The first filename is preceded by a space
body: <p>The names of all of them are changing properly, but the first file has a space in its name.</p>
  
  <p>This my code:</p>
  
  <pre><code>import os
  
  def dtr(x, y):
  
      os.chdir(str(x))
      c = os.listdir()
  
      c1 = str(c).replace(str(y), "")
      c_1 = c1.replace("[", "")
      c_2 = c_1.replace("]", "")
      c_3 = c_2.replace("'", "")
      c_dtr = c_3.split(",")
  
  
      x = 0
      while x &lt; len(c):
          os.rename(c[x],c_dtr[x])
          x += 1 
  
  dzn = input("Dizin: ")
  dgtr = input("Değiştir: ")
  dtr(dzn, dgtr)
  input()
  </code></pre>