Path: Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 12 Sep 2022 11:43:24 +0000 Newsgroups: fr.comp.lang.python Subject: Problème boucl X-poster: PEAR::Net_NNTP v1.5.0 (stable) From: gigi123 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Organization: !No_Organization! Message-ID: Date: Mon, 12 Sep 2022 11:43:24 +0000 Lines: 40 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-pdCuY1eUEZVM/O/7qEER91hx5HKTZ3TScA/c3RZKqiAOayAcd+3qqyr9LgEIL+XBKGVnrY80xHgbVD0!H8Yagd4NMwiVZInA4y2uJZWnFsBmNk4OAiYsoRPHcklAgKm1lx1IMFhfqVJnXqqS8ZzkfDBTQx4C X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 Bytes: 2254 Bonjour, Voilà j'aimerai que mon élément res[j] s'incrémente lorsqu'il trouve la condition d'égalité avec la 2nd liste, sans sortie de la boucle while. voici le code : identique = True a=0 #variable qui parcours ma 2nd liste b=0 #compteurs catégorie urnes standars c=0 #compteurs catégorie consommables d=0 #compteurs catégorie urnes décoratives e=0 #compteurs catégorie cyclavet f=0 #compteurs catégorie bijoux g=0 #variable qui parcours ma 1ère liste j=0 #VARIABLE PREMIERE LISTE while identique == True and j==0 : if res[j] != conso[a]: a = a+1 if res[j]==conso[a]: res[j]=res[j+1] if conso1[a] == 'Catégorie A': b=b+1 else: if conso1[a] == 'Catégorie B': c=c+1 else: if conso1[a] == 'Catégorie C': d=d+1 else: if conso1[a] == 'Catégorie F': e=e+1 else: if conso1[a] == 'Catégorie G': f=f+1 identique = False