Advertisement
Guest User

Untitled

a guest
Dec 16th, 2015
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. def mycmp(x,y,q='m'):
  2.  
  3. if x.index(q) < y.index(q):
  4. return -1
  5. elif x.index(q) > y.index(q):
  6. return 1
  7. else:
  8. return 0
  9.  
  10. p=['abc@123.com', 'nee@123.com', 'm@123.com']
  11. p.sort(mycmp)
  12. //p=['m@123.com', 'abc@123.com', 'nee@123.com']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement