Snippets Collections
#define function
defall_unique(lst):

   return len(lst) == len(set(lst))
   
x = [1,1,2,2,3,2,3,4,5,6]


y = [1,2,3,4,5]


all_unique(x) # False
all_unique(y) # True
star

Tue Mar 31 2020 11:40:31 GMT+0000 (Coordinated Universal Time) https://towardsdatascience.com/30-helpful-python-snippets-that-you-can-learn-in-30-seconds-or-less-69bb49204172

#python #python #function #return #allunique

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension