title: Appending a key to a dictionary (Python)
body: <p>I try to update a key in a dictionary. I use <code>.aapend()</code> method but i get following error:</p>
  
  <pre><code>AttributeError: 'str' object has no attribute 'append'
  </code></pre>
  
  <p>Here is the code:</p>
  
  <pre><code>class FileOwners:
  @staticmethod
  def group_by_owners(files):
      fileName=[]
      tempName=[]
      final={}
      for i in files:
        for j in files:
          if files.get(j) not in tempName:
            tempName.append(files.get(j))
            fileName.append(i)
            final.update({files.get(j):i})
            break
          else:
            final.setdefault(files.get(j), []).append(i)  
      return final
  
  files = {
      'Input.txt': 'Randy',
      'Code.py': 'Stan',
      'Output.txt': 'Randy'
  }
  print(FileOwners.group_by_owners(files))
  </code></pre>