A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/python/json-load-in-python/ below:

json.load() in Python - GeeksforGeeks

json.load() in Python

Last Updated : 03 Jul, 2025

json.load() function in Python is used to read a JSON file and convert it into a Python object, such as a dictionary or a list. JSON (JavaScript Object Notation) represents data as key/value pairs, where keys are strings and values can be different JSON data types.

Syntax

json.load(file_object)

Parameters: It takes file object as a parameter.

Return: It return json object.

Example

Let’s say we have a JSON file named data.json with the following structure:

json.load

We can read the file and access its content using json.load() as shown below:

Python
import json
 
# Opening JSON file
with open('data.json', 'r') as f:
    # Parsing the JSON file into a Python dictionary
    data = json.load(f)

for i in data['emp_details']:
    print(i)
 
# Closing file
f.close()

Output:



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4