vendredi 26 février 2016

Pythonic way to write cascading if statements

Is there a more Pythonic way to write the following function?

def foo():
    flag = False
    if condition1:
        if condition2:
            flag = True
    return flag

Aucun commentaire:

Enregistrer un commentaire