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