Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python remove first item in tuple

# By definition, tuple object is immutable. 
# Hence it is not possible to remove element from it. 
# However, a workaround would be convert tuple to a list, 
# remove desired element from list and convert it back to a tuple.

T1=(1,2,3,4)
L1=list(T1)
L1.pop(0)
T1=tuple(L1)
print(T1)	# (2, 3, 4)
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #python #remove #item #tuple
ADD COMMENT
Topic
Name
4+6 =