item = 75648
que =[{'user': {85555: {'search': 1, 'sex': 1}}},{'user': {75648: {'search': 2, 'sex': 2}}}, {'user': {85587: {'search': 1, 'sex': 1}}}]
{'user': {75648: {'search': 2, 'sex': 2}}}
словарь из списка que.for name in range(len(que)):
print(que[name]['user'].keys())
if item in que[name]['user'].keys():
del que[name]
item = 75648
que =[{'user': {85555: {'search': 1, 'sex': 1}}},{'user': {75648: {'search': 2, 'sex': 2}}}, {'user': {85587: {'search': 1, 'sex': 1}}}]
new_que = [q for q in que if item not in q['user'].keys()]
new_que
Out[5]:
[{'user': {85555: {'search': 1, 'sex': 1}}},
{'user': {85587: {'search': 1, 'sex': 1}}}]
que =[
{'user': 85555, 'search': 1, 'sex': 1},
...
]