skip to Main Content

Convert three lists with uneven length to JSON in python

I have 3 lists: filtered_headings = ['Educational Institutions', 'Number of students', 'Number of teaching staffs', 'Number of non- teaching staffs'] sub_headings = ['College/University', 'Basic Level', 'Secondary Level', 'Secondary Level', 'College/University', 'Basic Level', 'Secondary Level', 'College/University', 'Basic Level', 'Basic Level', 'College/University',…

VIEW QUESTION

Json – Connecting to an API and parsing the data

import requests import json def jprint(obj): text = json.dumps(obj, sort_keys=True, indent=4) if name == "main": response = requests.get("https://anapioficeandfire.com/api/characters/583") jprint(response.json()) data_list = response.json() my_dictionary = data_list[0] tvSeries = int(input("What series do you want to search?")) final_dictionary = {} for elem in…

VIEW QUESTION
Back To Top
Search