samedi 30 novembre 2019

How to stop code from continuing onto particular section once IF statement has been fullfilled?

I have multiple IF statements, that I want execute but once the logic for any of the IF statements has been fulfilled I want the code to skip over a particular section that is not included in any of the IF` statements.

How do I do this?

How code is setup currently:

 if 1 in df.index:
        if df.col1.isnull()[1] or (df.col1[1]==''):
           [rest of the code]

    if 2 in df.index:
        if df.col1.isnull()[2] or (df.col1[2]==''):
           [rest of the code]

    if 3 in df.index:
        if df.col1.isnull()[3] or (df.col1[3]==''):
           [rest of the code]


[code I want to skip once any of the IF statements have been fulfilled]

[code I need to run regardless]

Aucun commentaire:

Enregistrer un commentaire