Bonjour ,
alors voici mon problème , j'ai un code en python avec deux instructions après une boucle while , hors si je ne rentre pas dans la boucle , les deux instructions ne se font pas . Voici le code :
def sumary (tab):
indice = 1
tabbis = []
if len(tab)==0 :
print "veuillez entrer au moins un chiffre"
else :
for i in range (0,len(tab)-1):
counter=1
j=i
if len(tabbis)>0 :
if (tabbis[indice]== tab[j]) :
continue
while ( j<len(tab)-1 and tab[j] == tab [j+1]):
counter +=1
j +=1
if counter < 3 :
indice += 2
tabbis += [ counter ]
tabbis += [ tab[j] ]
return tabbis
les deux instructions dont je parle sont tabbis+= [counter] et tabbis += [ tab[j]] . Est-ce que quelqu'un aurait une explication ou éventuellement une solution ? Merci d'avance