This below code outputs [2,4].
I expected just only nothing like [].
Please tell me why this code does not work....
Thank you.
data = [1, 2, 3, 4, 5]
def checkio(data):
answer = data
for x in data:
count = data.count(x)
if count == 1:
answer.remove(x)
return answer
Created at: 2021/04/06 19:31; Updated at: 2021/04/07 06:34
The question is resolved.