title: Parsing reddit json into Python array and print items from array
body: <p>This is my first couple of weeks coding; apologies for a basic question.</p>
  
  <p>I've managed to parse the 'WorldNews' subreddit json, identify the individual children (24 of them as I write) and grab the titles of each news item. I'm now trying to create an array from these news titles. The code below does print the fifth title ([4]) to command line every 2-3 attempts (otherwise provides the error below). It will also not print more than one title at a time (for example if I try[2,3,4] I will continuously get the same error). </p>
  
  <p>The error I get when doesn't compile: </p>
  
  <pre><code>in &lt;module&gt; Children = theJSON["data"]["children"] KeyError: 'data'
  </code></pre>
  
  <p>My script:</p>
  
  <pre><code>import requests 
  import json
  
  
  r = requests.get('https://www.reddit.com/r/worldnews/.json')
  theJSON = json.loads(r.text)
  Children = theJSON["data"]["children"]
  
  News_list = []
  
  for post in Children:
      News_list.append (post["data"]["title"])
  
  print News_list [4] 
  </code></pre>