Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

remove last element from dictionary python

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
 
PREVIOUS NEXT
Tagged: #remove #element #dictionary #python
ADD COMMENT
Topic
Name
9+5 =