Here, we are implementing a python program to check whether all elements of a list are unique or not?
It's very simple to check, by following two steps
- Convert the list in a set (as you should know that set contains the unique elements) – it will remove the duplicate elements if any.
- Then, compare the length of the list and set – if both are the same then all elements are unique.
Program:
Output
need an explanation for this answer? contact us directly to get an explanation for this answer