title: Grab values from JSON objects in Python and assign them to a variable
body: <p>I would like to grab some values within a JSON object using Python and assign them to variables for further use in the html frontend. </p>
  
  <p>I tried it using the w3c resource and by googling but I can't get any successful print:</p>
  
  <pre><code>import requests
  import json
  
  response = requests.get("https://www.api-football.com/demo/api/v2/teams/team/33")
  team_data = response.json()
  
  team_name = team_data.teams.name
  
  print(team_name)
  </code></pre>
  
  <p>This is the JSON Object i get from the external API:</p>
  
  <pre><code>{
      "api": {
          "results": 1,
          "teams": [
              {
                  "team_id": 33,
                  "name": "Manchester United",
                  "code": "MUN",
                  "logo": "https://media.api-football.com/teams/33.png",
                  "country": "England",
                  "founded": 1878,
                  "venue_name": "Old Trafford",
                  "venue_surface": "grass",
                  "venue_address": "Sir Matt Busby Way",
                  "venue_city": "Manchester",
                  "venue_capacity": 76212
              }
          ]
      }
  }
  </code></pre>
  
  <p>The debug console tells me <code>AttributeError: 'dict' object has no attribute 'teams'</code></p>