python remove first item in tuple

Solutions on MaxInterview for python remove first item in tuple by the best coders in the world

showing results for - "python remove first item in tuple"
Viktoria
14 Apr 2019
1# By definition, tuple object is immutable. 
2# Hence it is not possible to remove element from it. 
3# However, a workaround would be convert tuple to a list, 
4# remove desired element from list and convert it back to a tuple.
5
6T1=(1,2,3,4)
7L1=list(T1)
8L1.pop(0)
9T1=tuple(L1)
10print(T1)	# (2, 3, 4)