0

To find the duplicates

def dup (l): s=[] for i in l: if (l.count (i)>1): s.append (i) print (s) x=[1,2,2,3,4,5,5,6] dup (x) OUTPUT: [2,5]

4th Oct 2017, 1:00 PM
Chilukuri Sri Jyothsna Devi
Chilukuri Sri Jyothsna Devi - avatar
1 Antwort