Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- items = ['a','c','d','e','f','s'] #items are unique (can be a set)
- special_items = ['e','a']
- items = ['c','d','f','s','e','a'] # e,a now at the end
- items = [item for item in items if item not in special_items] #remove special items
- items.extend(special_items) #add them to the end of the list
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement