I have written below logic to merge two json files in python, it works perfectly fine. Now, I want to pass only one parameter to the method "filename" and i can pass "n" number of files and they should be able to merge. How i can apply that "forloop" and merge all json ?
def merge_JsonFiles(file1, file2):
first_json = load_json(file1)
second_json = load_json (file2)
merge_json = {**first_json, **second_json}
return merge_json