title: Python - AttributeError: 'dict' object has no attribute 'replace'
body: <p>Whenever I run the code below, I get this error:</p>
  
  <blockquote>
    <p>AttributeError: 'dict' object has no attribute 'replace'</p>
  </blockquote>
  
  <p>I am unsure how to fix this. I want to search the json file and find "Screenshot Package" and replace it with user input but I just get that error.</p>
  
  <p>My code:</p>
  
  <pre><code>numberofscreenshots = input("How much screenshots do you want?: ")
  
  if numberofscreenshots == "1":
  
      screenshoturl = input("Link to screenshot: ")
  
      with open('path/to/json/file','r') as f:
          data = f.read()
  
      data = json.loads(data)
  
      # Check the data before.
      print( data['tabs'][0]['views'][1]['screenshots'] )
  
      # Overwrite screenshots placeholders in template file if more then one.
      data['tabs'][0]['views'][1]['screenshots']  =  data['tabs'][0]['views'][1]['screenshots'][0]
  
      # Check after to make sure it worked.
      print( data['tabs'][0]['views'][1]['screenshots'] )
  
      # Now search for the screenshot option and add users input.
      screenshotplaceholdertext = {"Screenshot URL 1":screenshoturl}
      for removescreenshotplaceholders in data:
          for screenshotplaceholder, removescreenshotplaceholder in screenshotplaceholdertext.items():
              removescreenshotplaceholders = removescreenshotplaceholders.replace(screenshotplaceholder, removescreenshotplaceholder)
          data.replace(removescreenshotplaceholders)
  
      # Write data to JSON file.
      with open('path/to/json/file', 'w') as f:
          f.write(json.dumps(data))
  else:
      print("Something went wrong.")
  </code></pre>
  
  <p>Any help would be nice. Thanks!</p>