а = [10,20,30,20,10,50,60,40,80,50,40] dup_items = set() uniq_items = [] for x in a: if x not in dup_items: uniq_items.append(x) dup_items.add(x) print(dup_items)Hi can anyone explain the above code for me?
list problem
list problem
|
|
Messages In This Thread |
list problem - by pythonCrazy - Jul-27-2018, 05:01 PM
RE: list problem - by ichabod801 - Jul-27-2018, 06:15 PM
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
Problem with "Number List" problem on HackerRank | Pnerd | 5 | 3,462 |
Apr-12-2022, 12:25 AM Last Post: Pnerd |
Users browsing this thread: 1 Guest(s)