extract json in object and print in python

main.py
import json

# sample JSON data
json_data = '{"name": "John", "age": 30, "city": "New York"}'

# parsing JSON
parsed_json = json.loads(json_data)

# accessing the values
name = parsed_json['name']
age = parsed_json['age']
city = parsed_json['city']

# printing the values
print('Name:', name)
print('Age:', age)
print('City:', city)
333 chars
18 lines

Output will be:

main.py
Name: John
Age: 30
City: New York
34 chars
4 lines

gistlibby LogSnag