mercredi 7 décembre 2016

Python - does IF NOT statement implicitly check 2 conditions?

def randomFunction(value):
    if value:
        return True
    else:
        return False

def secondFunction(files):
    for file in files
        if ".file" in file:
            doSomething()

            if not randomFunction(True)
                x += 1

I was told that the randomFunction will be called automatically when calling the secondFunction and it will implicitly check 2 conditions despite not having an else statement. However, I am still not clear on this. Appreciate your help!

Aucun commentaire:

Enregistrer un commentaire