I have the following list, composed by a list of lists, I would like to take it:
list = [[original1,type1,unknow],[original2,type2,general]]
and to generate the following result, using List Comprehensions, the idea is to verify if the last element is unknow then return the original element if not return the general, for that i need to search with maybe two for's i tried:
desired output:
newList = [origina1,general]
I tried, however i am confusing with the sintaxys of comprenhension lists, i hope someone could support me
newList =[ x if list[3] == 'unknow' else x == general for x in list]