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

2015-10-21 Thread bigred04bd3
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
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2015-10-21 Thread bigred04bd3
O...MG I cannot believe I just asked this question ha.  I ended up 
realizing I need to use an elif after I took a break from it and re read 
everything...Brain fart, thanks for replies.

Brice
-- 
https://mail.python.org/mailman/listinfo/python-list