0
Q:

remove dict last element

for k, v in listDict.items():
    v.pop()
0
D={1:'a',2:'b',3:'c'}
x=D.popitem()
print(D,x)
>>>{1:'a',2:'b'} (3,'c')
#x is the removed item, D is the rest of the dict
0

New to Communities?

Join the community