Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.14 KB | None | 0 0
  1. def all_unique(lst):
  2. return len(lst) == len(set(lst))
  3.  
  4.  
  5. x = [1,1,2,2,3,2,3,4,5,6]
  6. y = [1,2,3,4,5]
  7. all_unique(x) # False
  8. all_unique(y) # True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement