kentang2017/kinliuren

def unique(list1)

Closed this issue · 0 comments

Hi,

What is the purpose of this function :

def unique(list1):
unique_list = []
for x in list1:
if x not in unique_list:
unique_list.append(x)
return x

since unique_list is empty when called it return the first value of list1
is this case unique(list1) is equal to list1[0]

Thank you for explaining this.

Regards