← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #256304]: If statement problem

 

Question #256304 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/256304

    Status: Open => Answered

RaiMan proposed the following answer:
you already have n as a counting value (takes 0, 1 and 2).

for n in range(3):
    if n == 0 or n == 2:
        click("image1.png")
        click("imageOK.png")
    else  :
        click("image2.png")
        click("imageOK.png")

n == 0 or n == 2
could be replaced by
n%2 == 0 (checks wether the remainder of dividing by 2 is 0)

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.