Suppose if my List has
list = {[1,2],2,[],[1,2,3]}eg:
list{1} = [1,2] = %% print last element ==>> 2 list{2} = 2 list{3} = [] list{4} = [1,2,3] ==> 3 new_list = {2,2,[],3}
I need to extract last element from each list{i} Output should be like
new_list = {2,2,0,3}
Best Answer