jeudi 29 octobre 2020

While does not go in the next block

I have been stuck on this problem for about 1 hour : I want my command while to access in the next block. Case is a class: cases is the object. I made a definition that say on some condition : my object case become NoneType. There is the condition if element_voisin == case to be sure that the element is still a case and not a NoneType. If it's still a case I want to access case.ajouter une mine voisine() but my program won't go in. If you need more information tell me! I relly want this to work please.

            for element in coordonnees_voisine:
                element_voisin = self.obtenir_case(element[0], element[1])              
                if element_voisin == case: 
                    case.ajouter_une_mine_voisine()
                else:
                    None

Aucun commentaire:

Enregistrer un commentaire