title: Python, writing things to json
body: <p>I'm in this sort of a situation. I have 2 lists and two ints, I need to put them all into a JSON file so that I can pass it to another Python program. I would like the final file/structure to be something along the lines of:</p>
  
  <pre><code> File:{
          numbers : [1,2,3]
          strings : ["a", "b" , "c"]
          x : 0
          y : 0
      }
  </code></pre>
  
  <p>Is there a way to do this in an automated fashion without explicitly writing it all as one massive string? I assume it uses dumps, but I am not entirely sure how to use it properly and how it will incorporate the variables tag (i.e. numbers, string) or how to do add each line to a single JSON structure.</p>
  
  <pre><code>import json
  n = [1, 2, 3]
  s = ["a", "b" , "c"]
  x = 0
  y = 0
  nums = json.dumps(n,)
  strings = json.dumps(s)
  print(nums)
  </code></pre>