vendredi 23 juin 2017

Difference between Nested IF/ELSE and ELIF?

Is there any semantic or runtime difference between these two different code organizations? Or is it simply a matter of brevity and whitespace?

if something:
    ...
else:
    if other:
        ...
    else:
        ...

Vs.

if something:
    ...
elif other:
    ...
else:
    ...

Aucun commentaire:

Enregistrer un commentaire