Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def drop_duplicates_in_place(lst):
- # Write the rest of the code for question 3b below here.
- i = 0
- while i < len(lst) - 1:
- if lst[i + 1: len(lst) - 1].count(lst[i]) > 0 :
- k = len(lst)
- for x in range (i + 1 , k):
- if lst[x] == lst[i] :
- del lst[x]
- k = k - 1
- i = i + 1
- lst = [1,2,3,4,5,6,7,8,8,2,666,9]
- drop_duplicates_in_place(lst)
- print(lst)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement