Program-12:-Tuple and Its Operations
Program-12:-Tuple and Its Operations
Output :
Original A : (23,45,56,68,10,45,7,9)
After Removing: (23,45,68,10,45,7,9)
Output :
{‘Ram’:1, ‘Shyam’:2, ‘Sohan’:3}
(vi) Write a Python program to replace the last value of tuple in a list.
L = [(10,20,30),(40,50,60),(70,80,90)]
print([t[:-1]+(600,) for t in L])
Output :
[(10,20,600),(40,50,600),(70,80,600)]