Gestalt Shift
Thursday, June 20, 2013
Check for duplicates in Python
Today's trick: Check whether a Python container
cont
contains duplicates!
if len(cont) != len(set(cont)): raise myError
Neat!
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment