import json def analysis(file,user_id): times=0 minutes=0 f=open(file) data=json.load(f) f.close() for items in data: if items['user_id']==user_id: times+=1 minutes+=items['minutes'] print('study',times,'minutes',minutes) analysis('user_study.json',199071)
125jz网原创文章。发布者:江山如画,转载请注明出处:http://www.125jz.com/10199.html