a = [0, 22, 2, 3, 44, 5, 6, 27, 8, 19]
print(a)
print(set(a))
but I need it like this
output:
[0, 22, 2, 3, 44, 5, 6, 27, 8, 19]
{0, 2, 3, 5, 6, 8, 44, 19, 22, 27}
for getting this kind of output I can use list with for.. too with bellow cade or by method ( removing duplicates from list ).. there are many ways.. but
lis = []
for i in a:
if i in lis:
lis.append(i)
print(lis)
output:
[0, 22, 2, 3, 44, 5, 6, 27, 8, 19]
but the thing is I need to get this kind of output in set function, and give me the reason why it is changing in order.. or who this transformation workes ???