title: Python Crash Course Chapter 17- The Hacker News API
body: <pre><code>import requests
  from operator import itemgetter
  
  #make an API call and store the response
  url = 'https://hacker-news.firebaseio.com/v0/item/9884165.json'
  r = requests.get(url)
  print('Status code:' , r.status_code)
  
  #process info about each submission
  submission_ids = r.json()
  submission_dicts = []
  for submission_id in submission_ids:
      #make separate API call for each submission
      url = (&quot;https://hacker-news.firebaseio.com/v0/item/&quot; 
             + str(submission_id)+ '.json')
  submission_r = requests.get(url)
  print(submission_r.status_code)
  response_dict = submission_r.json()
  submission_dict = {'title' : response_dict['title'],
                     &quot;link&quot; : 'https://hacker-news.firebaseio.com/v0/item?id='
                     + str(submission_id) + '.json',
                     'comments': response_dict.get('descendants', 0),
                     }
  submission_dicts.append(submission_dict)
  
  submission_dicts = sorted(submission_dicts, key=itemgetter('comments'),
                            reverse=True)
  
  for submission_dict in submission_dicts:
      print(&quot;\nTitle:&quot;, submission_dict['title'])
      print(&quot;Discussion link:&quot;, submission_dict['link'])
      print(&quot;Comments:&quot;, submission_dict['comments']) 
  </code></pre>
  <p>when i try to run my code, i get an error saying that 'NoneType' object is not callable</p>
  <pre><code>submission_dict = {'title' : response_dict['title'],
  TypeError: 'NoneType' object is not subscriptable
  </code></pre>
  <p>the expected output should be the title of the current top articles in Hacker News along with the number of comments and link of the article.
  can someone tell me what part of my code went wrong and how can i fix it?</p>