Conditions

n = 6
print("Début")
if n> 10 or n <0 :
print("branche if")
elif n <5 :
print("branche elif")
else :
print("branche else")
print("fin")

donne

Début
branche else
fin

“”

<font 10pt/inherit;;inherit;;inherit>n = 12
print("Début")
if n> 10 or n <0 : #True
print("branche if")</font>elif n <5 : #Non testée
<font inherit/inherit;;inherit;;inherit>print("branche elif")</font>else :
<font inherit/inherit;;inherit;;inherit>print("branche else")</font>print("fin")

“”“”

<font 10pt/inherit;;inherit;;inherit>n = 4
print("Début")
if n> 10 or n <0 : #False
print("branche if")</font>elif n <5 : #True
<font inherit/inherit;;inherit;;inherit>print("branche elif")</font>else :
<font inherit/inherit;;inherit;;inherit>print("branche else")</font>print("fin")

“”“”“”

<font 10pt/inherit;;inherit;;inherit>n = 8
print("Début")
if n> 10 or n <0 : #False
print("branche if")</font>elif n <5 : #False
<font inherit/inherit;;inherit;;inherit>print("branche elif")</font>else :
<font inherit/inherit;;inherit;;inherit>print("branche else")</font>print("fin")

<font 10pt/inherit;;inherit;;inherit>n = 12
print("Début")
if n > 10 or n < 0 :
print</font><font inherit/inherit;;inherit;;inherit>(</font><font inherit/inherit;;inherit;;inherit>"branche if"</font><font inherit/inherit;;inherit;;inherit>)</font>
print("Fin")

<font 10pt/inherit;;inherit;;inherit>Début
branche if
Fin</font>

<font 10pt/inherit;;inherit;;inherit>n = 6
print("Début")
if n > 10 or n < 0 :
print</font><font inherit/inherit;;inherit;;inherit>(</font><font inherit/inherit;;inherit;;inherit>"branche if"</font><font inherit/inherit;;inherit;;inherit>)</font>
print("Fin")

<font 10pt/inherit;;inherit;;inherit>Début
Fin</font>