My question is about task "Non-unique Elements" (http://www.checkio.org/mission/task/info/non-unique-elements/)
I'm guessing this is a silly mistake, but I'm stumped. I can't figure out why this works for the first list but not the 2nd.
My Code:
def checkio(data):
#Your code here
#It's main function. Don't remove this function
#It's using for auto-testing and must return a result for check.
newlist = data
for item in data:
if data.count(item) == 1:
newlist.remove(item)
#replace this for solution
return newlist
It removes the other unique numbers, but not 2 and 4?
Can someone show me the right direction to go to figure this out? No amount of googling or stackoverflow browsing has shed much light on the issue so far :P
P.S sorry if I posted this thread twice. First time my internet cut out and I can't find it anywhere so I assumed it didn't get posted.
Created at: 2013/07/20 22:53; Updated at: 2014/07/09 19:32