python arret du programme code example
Example: comment arrêter l'exécution d'un programme python
>>> import sys
>>> x = 1
>>> for i in range(10):
... x = x + 1
... if x > 7:
... print x
... sys.exit()
...
8
>>> import sys
>>> x = 1
>>> for i in range(10):
... x = x + 1
... if x > 7:
... print x
... sys.exit()
...
8