Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def dupefinder(lister):
- '''Function to find first duplicate in a list; Variable to pass
- to this function should be of type "list" '''
- listerdupe = sorted(lister)
- for index,item in enumerate(listerdupe):
- if item == listerdupe[index+1]:
- print('First duplicate number is {0}'.format(item))
- return item
Add Comment
Please, Sign In to add comment