Search
 
SCRIPT & CODE EXAMPLE
 

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)
Comment

PREVIOUS NEXT
Code Example
Python :: print output python to file 
Python :: python xml replace attribute value 
Python :: convert string to list python 
Python :: Math Module sqrt() Function in python 
Python :: force garbage collection in python 
Python :: python django shell command 
Python :: strptime 
Python :: transform categorical variables python 
Python :: how to load keras model from json 
Python :: read json file python 
Python :: reverse text python 
Python :: converting binary to octal in python 
Python :: python remove last element from list 
Python :: collections counter 
Python :: measure cell execution time in ipython notebook 
Python :: pre commit python 
Python :: remove 1st column pandas 
Python :: count lines in file python 
Python :: Filter pandas DataFrame by substring criteria 
Python :: python instagram downloader 
Python :: second y axis matplotlib 
Python :: s = 1 + 2 + ... + n in python 
Python :: python fill a list 
Python :: how to close windows in selenium python without quitting the browser 
Python :: python convert number in array to integer 
Python :: path of current working directory with os module python 
Python :: csrf token fetch django 
Python :: what is imageTk in pil python 
Python :: how to import axes3d 
Python :: df = df.reset_index(level=0) 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =