Task is find number of equal elements in 2 lists,which are contain lists. I have 2 lists which looks like
DNF1=[[4], [12], [20], [28,32], [36], [44], [52,54], [60,4],[60,24]]
DNF2=[[16], [20,60], [24], [28,32], [48], [52], [56,58], [60,4]]
This code does not work cause arguments are lists:
count=sum(1 for k in DNF1 if k in DNF2)
How can I write
func(DNF1,DNF2)
which will return
[[28,32],[60,4]]
or just '2' (amount of elements in intersection)