My project requires a JSON file to remember a string of words. The code converts a list:
lst = ['Hello', ' there', ' world!']
Into a string on the JSON file. It does this by using the code:
lst = "".join(lst)
jsonFile = open("example.json", "w")
jsonFile.write(json.dumps(lst))
jsonFile.close()
New example.json:
"Hello there world!"
How do I then convert example.json
back into lst
as a usable list?