I have a list of tuples like
data = [(1,2,3),('soni','ansh','shivika'),('female','male','female')]
Now I want to extract the 2nd element from the tuples of list i.e.,
Output should be like:
[2, 'ansh', 'male']
How can I acheive this?
data = [(1,2,3),('soni','ansh','shivika'),('female','male','female')]
n = 1
print([x[n] for x in data])
this is another way.....
OR