def nombreDistincts(L): n = 0 for i in range(0,len(L)-1): if L[i] != L[i+1]: n = n + 1 return n