Skip to content

Instantly share code, notes, and snippets.

@maelysBB
Last active October 25, 2022 12:50
Show Gist options
  • Save maelysBB/6cb1fc10d036ec97c91ff5ffb641cbc8 to your computer and use it in GitHub Desktop.
Save maelysBB/6cb1fc10d036ec97c91ff5ffb641cbc8 to your computer and use it in GitHub Desktop.
>>> 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