Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > fr.comp.lang.python > #3936

Problème boucl

Newsgroups fr.comp.lang.python
Subject Problème boucl
From gigi123 <nospam_giannivolturno5@gmail.com.invalid>
Organization !No_Organization!
Message-ID <nr-dnXJMLK7BhoL-nZ2dnZfqlJxh4p2d@giganews.com> (permalink)
Date 2022-09-12 11:43 +0000

Show all headers | View raw


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

Back to fr.comp.lang.python | Previous | NextNext in thread | Find similar


Thread

Probl�me boucl gigi123 <nospam_giannivolturno5@gmail.com.invalid> - 2022-09-12 11:43 +0000
  Re: Probl�me boucl Dominique <zzz@aol.com> - 2022-09-12 18:20 +0200
    Re: Probl�me boucl gigi123 <nospam_giannivolturno5@gmail.com.invalid> - 2022-09-13 07:47 +0000

csiph-web