Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python list pop equivalent

# Python pop() equivalent
mylist = ['a', 'b', 'c', 'd', 'e']
# remove 'b'
mylist = mylist[:1] + mylist[1+1:]
# return ['a', 'c', 'd', 'e']
A = 0
A, mylist = A + 9, mylist[:1] + mylist[1+1:]
# return 9 ['a', 'd', 'e']
Source by www.howtouselinux.com #
 
PREVIOUS NEXT
Tagged: #python #list #pop #equivalent
ADD COMMENT
Topic
Name
5+1 =