Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. items = ['a','c','d','e','f','s'] #items are unique (can be a set)
  2. special_items = ['e','a']
  3.  
  4. items = ['c','d','f','s','e','a'] # e,a now at the end
  5.  
  6. items = [item for item in items if item not in special_items] #remove special items
  7. items.extend(special_items) #add them to the end of the list
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement