-
-
Save maelysBB/6cb1fc10d036ec97c91ff5ffb641cbc8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> first_names = ['Theo', 'Laura', 4, 'Joe'] | |
>>> for name in first_names: #On sort de la boucle si l'élément n'est pas de type string | |
>>> if type(name) != str: | |
>>> break | |
>>> print(name) | |
>>> print("The for loop is over") | |
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
Theo | |
Laura | |
The loop is over |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment