0

I am trying to append to a list in json file please see below example.

filename = websites.json

{"id": "json_key", "website": ["amazon.com", "facebook.com", "google.com"]}

For example, I want to add another website to the "website" list using user input and sort them by alphabetical order.

Ex.
user input: quora.com

Output:
{"id": "json_key", "website": ["amazon.com", "facebook.com", "google.com", "quora.com"]}

Is it possible?

0 Answers0