dimanche 5 avril 2020

SyntaxError in the middle of an if statement [closed]

When I try to run my code Python tells me that there is a SyntaxError in my if statement. Why did it occur?

This is the error:

if wynik = 0 and cy20 == cy19 == cy18 == cy17 == cy16 == cy15 == cy14 == cy13 == cy12 == cy11 == cy10 == cy9 == cy8 == cy7 == cy6 == cy5 == cy4 == cy3 == cy2 == '0':
             ^
SyntaxError: invalid syntax

And this is that problematic fragment of code:

   cy1 = str(cy1)
   cy2 = str(cy2)
   cy3 = str(cy3)
   cy4 = str(cy4)
   cy5 = str(cy5)
   cy6 = str(cy6)
   cy7 = str(cy7)
   cy8 = str(cy8)
   cy9 = str(cy9)
   cy10 = str(cy10)
   cy11 = str(cy11)
   cy12 = str(cy12)
   cy13 = str(cy13)
   cy14 = str(cy14)
   cy15 = str(cy15)
   cy16 = str(cy16)
   cy17 = str(cy17)
   cy18 = str(cy18)
   cy19 = str(cy19)
   cy20 = str(cy20)
   wynik = str(wynik)

   if wynik = 0 and cy20 == cy19 == cy18 == cy17 == cy16 == cy15 == cy14 == cy13 == cy12 == cy11 == cy10 == cy9 == cy8 == cy7 == cy6 == cy5 == cy4 == cy3 == cy2 == '0':
       wynik = cy1

I tried restarting the IDE and putting another and in the place where the error occured.

Thanks in advance

Aucun commentaire:

Enregistrer un commentaire