title: In python, how do you write a text file that contains brakets and quotes?
body: <p>Python beginner here, I am really struggling with a text file I want to print:</p>
  
  <pre><code>{"geometry": {"type": "Point", "coordinates": 
  [127.03790738341824,-21.727244054924235]}, "type": "Feature", "properties": {}}
  </code></pre>
  
  <p>The fact that has multiple brackets confused me and it throws <code>Syntax Error</code> after trying this:</p>
  
  <pre><code>def test():
      f = open('helloworld.txt','w')
      lat_test = vehicle.location.global_relative_frame.lat
      lon_test = vehicle.location.global_relative_frame.lon
      f.write("{"geometry": {"type": "Point", "coordinates": [%s, %s]}, "type": "Feature", "properties": {}}" % (str(lat_test), str(lat_test)))
      f.close()
  </code></pre>
  
  <p>As you can see, I have my own variable for latitude and longitude, but python is  throwing a syntax error:</p>
  
  <pre><code>File "hello.py", line 90
  f.write("{"geometry": {"type": "Point", "coordinates": [%s, %s]}, "type": 
  "Feature"" % (str(lat_test), str(lat_test)))
                    ^
  SyntaxError: invalid syntax
  </code></pre>
  
  <p>Thanks a lot in advance for any help.</p>