File size: 277 Bytes
4daa863
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
import json
with open("mbpp_with_token+cc.json","r",encoding="utf-8") as f:
    data = json.load(f)
i=0
for item in data:
    item["id"]=i
    i=i+1
print(i)
with open('mbpp.json', 'w', encoding='utf-8') as file:
    json.dump(data, file, ensure_ascii=False, indent=4)