I am writing a code to analyze a JSON file. And I want my output as a txt file. The code is as follows..
inputFile = "C:\Users\nk\Documents\survey\data.json"
outfile= "C:\Users\nk\Documents\survey\data_summary.txt"
json_file = open(inputFile, 'r', encoding="utf8")
jsondb = json.load(json_file)
fs = open(outFile, 'w')
#some loops in between
fs.flush()
fs.close()
after running this code in jupyter notebook, it is showing error like
inputFile = "C:\Users\nk\Documents\survey\data.json" ^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escap
What to do ? and how to write??? I am new to programming.