I would like to get the number of different values found in a List.
For example:
The output for the List a={1,2,3,4,5} would be 5 whereas it would b
a={1,2,3,4,5}
Use DeleteDuplicates (or Union in older versions) to remove duplicate elements. You can then count the elements in the returned list.
Union
In[8]:= Length[DeleteDuplicates[a]] Out[8]= 5 In[9]:= Length[DeleteDuplicates[b]] Out[9]= 2