Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> unique([1, 2, 3])
- True
- >>> unique([2, 4, 3, 4])
- False
- def unique(lst):
- if len(lst) == 1:
- return True
- else:
- if lst[0] in lst[1:]:
- return False
- if lst[1] in unique(lst[2:-1]):
- return False
- else:
- return True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement