Python si indentation
Indentations dans If
Python s'appuie sur l'indentation (espace au début d'une ligne) pour définir la portée dans le code. D'autres langages de programmation utilisent souvent des accolades à cette fin.
Exemple
Remarquez l'indentation à l'intérieur du bloc if :
a = 33
b = 200
if b > a:
print("b is greater than a")
Exemple
Si l'instruction, sans indentation (soulèvera une erreur):
a = 33
b = 200
if b > a:
print("b is greater than a")
# you will get an error