Skip to content

Instantly share code, notes, and snippets.

@fitomad
Created January 21, 2019 07:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fitomad/faba192caad83d496fa940ecdcf8d4b1 to your computer and use it in GitHub Desktop.
Save fitomad/faba192caad83d496fa940ecdcf8d4b1 to your computer and use it in GitHub Desktop.
let numeros = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
for numero in numeros
{
if numero.isMultiple(of: 3)
{
print("\(numero) es múltiplo de 3")
}
}
// La salida en el terminal es...
// 0 es múltiplo de 3
// 3 es múltiplo de 3
// 6 es múltiplo de 3
// 9 es múltiplo de 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment