How to make my loop properly work and move on to the next after it's done it's work?

41 Views Asked by At

I'm trying to get my loop to check for one thing multiple times, and if a value surpasses another value, it ends and goes to the next loop.

What I have right now is this:

x = 1
a = 7
complete = False
while complete == False:
    click(Im using sikulix so theres an image of what its supposed to click here)
    x == x+1
    if x > a:
        complete == True
    else:
        complete == False

What doesn't work with this script is that the loop doesn't end, it just keeps going. I've tried putting a break after the complete == True but it doesn't change anything. What could I change to make this work as expected?

1

There are 1 best solutions below

2
Waffle On

Typo: == is comparison, use = for assignment.

– Barmar

I did not know this, thanks! (I'm still very new to coding)