0

How to print duplicate item from a list?

9th May 2021, 2:21 PM
SammE
SammE - avatar
2 ответов
+ 4
Search before asking!! where is your attempt? lst=[1, 2,3,4,2,5,6,6,2] lst=list(set(lst)) print(lst) # [1,2,3,4,5,6] # answering your question lst=[1, 2,3,4,2,5,6,6,2] for i in lst: if lst.count(i) > 1: print(i)
9th May 2021, 2:25 PM
Ratnapal Shende
Ratnapal Shende - avatar