Check if list has no duplicates
Checks if all the values in a list are unique.
- Use
set()
on the given list to keep only unique occurrences. - Use
len()
to compare the length of the unique values to the original list.
Checks if all the values in a list are unique.
set()
on the given list to keep only unique occurrences.len()
to compare the length of the unique values to the original list.