I have two lists:
l1=['TUDCAPL.CLM_NUM_CD',
'TUDCAPL.CRT_TS',
'TUDCAPL.CLM_NUM_CD',
'TUDCAPL.CRT_TS',
'TUDCAPJ.CLM_NUM_CD',
'TUDCAPJ.CRT_TS']
l2 = ['TUDCAPL.CLM_NUM_CD',
'TUDCAPL.CRT_TS']
I want my result to be
l3 = ['TUDCAPL.CLM_NUM_CD',
'TUDCAPL.CRT_TS',
'TUDCAPJ.CLM_NUM_CD',
'TUDCAPJ.CRT_TS']
I used l3 = [x for x in l1 if x not in l2]
but the result is ['TUDCAPJ.CLM_NUM_CD','TUDCAPJ.CRT_TS']
ignoring the duplicates. How can I get the duplicates along with other unique values?