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


Groups > comp.lang.python > #97864

If one IF is satisfied, skip the rest in the nest...

X-Received by 10.182.250.233 with SMTP id zf9mr8919706obc.7.1445448665084; Wed, 21 Oct 2015 10:31:05 -0700 (PDT)
X-Received by 10.50.77.70 with SMTP id q6mr648847igw.4.1445448665063; Wed, 21 Oct 2015 10:31:05 -0700 (PDT)
Path csiph.com!xmission!news.glorb.com!kq10no24830635igb.0!news-out.google.com!n2ni36988igy.0!nntp.google.com!kq10no24830628igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.python
Date Wed, 21 Oct 2015 10:31:04 -0700 (PDT)
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=75.77.31.97; posting-account=I1dMFwoAAAB-b9uaJe48QqEeVazTtStk
NNTP-Posting-Host 75.77.31.97
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <50a6789a-3965-430b-9a91-b08adcedf7bf@googlegroups.com> (permalink)
Subject If one IF is satisfied, skip the rest in the nest...
From bigred04bd3@gmail.com
Injection-Date Wed, 21 Oct 2015 17:31:05 +0000
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
Xref csiph.com comp.lang.python:97864

Show key headers only | View raw


So here what I have, I have a 3 IF's within the same level.  If one IF is satisfied, I would like to "skip" the other IFs and continue with my code.

# 4 second open
            if wb1_sheet1.cell(row=cell + 1, column=2).value == 0 and wb1_sheet1.cell(row=cell + 1, column=3).value == 0 and wb1_sheet1.cell(row=cell + 2, column=2).value == 0 and wb1_sheet1.cell(row=cell + 2, column=3).value == 0 and wb1_sheet1.cell(row=cell + 3, column=2).value == 0 and wb1_sheet1.cell(row=cell + 3, column=3).value == 0:
                open += 3
                open_seconds += 4
                start = wb1_sheet1.cell(row=cell + 4, column=2).coordinate
                break
            # 3 second open
            if wb1_sheet1.cell(row=cell + 1, column=2).value == 0 and wb1_sheet1.cell(row=cell + 1, column=3).value == 0 and wb1_sheet1.cell(row=cell + 2, column=2).value == 0 and wb1_sheet1.cell(row=cell + 2, column=3).value == 0:
                open += 3
                start = wb1_sheet1.cell(row=cell + 3, column=2).coordinate
                open_seconds += 3
                continue
            # 2 second open
            if wb1_sheet1.cell(row=cell + 1, column=2).value == 0 and wb1_sheet1               .cell(row=cell + 1, column=3).value == 0:
                open += 3
                start = wb1_sheet1.cell(row=cell + 2, column=2).coordinate
                open_seconds += 2


if any but the last IF is true, then all IFs will be true...that's my problem.

any help would be great

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


Thread

If one IF is satisfied, skip the rest in the nest... bigred04bd3@gmail.com - 2015-10-21 10:31 -0700
  Re: If one IF is satisfied, skip the rest in the nest... Ian Kelly <ian.g.kelly@gmail.com> - 2015-10-21 11:39 -0600
  Re: If one IF is satisfied, skip the rest in the nest... John Gordon <gordon@panix.com> - 2015-10-21 17:46 +0000
  Re: If one IF is satisfied, skip the rest in the nest... bigred04bd3@gmail.com - 2015-10-21 10:55 -0700
  Re: If one IF is satisfied, skip the rest in the nest... Denis McMahon <denismfmcmahon@gmail.com> - 2015-10-21 19:48 +0000
    Re: If one IF is satisfied, skip the rest in the nest... Grant Edwards <invalid@invalid.invalid> - 2015-10-21 20:07 +0000
      Re: If one IF is satisfied, skip the rest in the nest... Denis McMahon <denismfmcmahon@gmail.com> - 2015-10-22 02:08 +0000

csiph-web