daily pastebin goal
72%
SHARE
TWEET

Untitled

a guest Mar 21st, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def drop_duplicates_in_place(lst):
  2.     # Write the rest of the code for question 3b below here.
  3.   i = 0
  4.   while  i < len(lst) - 1:
  5.     if lst[i + 1: len(lst) - 1].count(lst[i]) > 0 :
  6.       k = len(lst)
  7.       for x in range (i + 1 , k):
  8.           if lst[x] == lst[i] :
  9.               del lst[x]
  10.               k = k - 1
  11.     i = i + 1
  12.  
  13. lst = [1,2,3,4,5,6,7,8,8,2,666,9]
  14. drop_duplicates_in_place(lst)
  15. print(lst)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top