a = [2,2,1,5,4,2,3,3] b = set(a)
c = [] for i in a: if i not in b: c.append(i) b.add(i) print(c)
output:[2, 1, 5, 4, 3]
Method 2:
a = [2,2,1,5,4,2,3,3] b = set(a) print(b) Output:[1,2,3,4,5]
a = [2,2,1,5,4,2,3,3] b = set(a) print(b)
Output:[1,2,3,4,5]
Enter your email address:
Delivered by FeedBurner
0 Comments