def checkio(data): lst = data for i in data: if data.count(i) == 1: lst.remove(i) return lst L = [2,4] print checkio(L)
The result is [4]. Can anyone kindly tell me why this happens?
Thanks.