Stuck with python attribute error as: 'list' object has no ...
www.technointeract.comDec 16, 2020 · AttributeError: 'list' object has no attribute 'keys'. I am trying to work with the dictionary from the file with the use of import. The below one is my dictionary: admins = [ {'id':0001,'name':"Admin",'type':1}, {'id',0002,'name':"Admin2",'type':1}] The below one is my method with which I am trying to work: def addAdminData (dict,entry): new = {} d = 0 for i in dict.keys (): new [i] = entry (d) d += 1 dict.append (new)