Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created July 5, 2019 23:48
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 parzibyte/9633c17e56b8c2288703ebbd70a0ce0a to your computer and use it in GitHub Desktop.
Save parzibyte/9633c17e56b8c2288703ebbd70a0ce0a to your computer and use it in GitHub Desktop.
// Ciclo del 0 al 9
// usando un rango
// https://parzibyte.me/blog/2019/07/05/rangos-kotlin/
val rangoDeNumeros = 0..9
for (numero in rangoDeNumeros) {
println(numero)
}
// Recorrer un arreglo
// Más sobre arreglos: https://parzibyte.me/blog/2019/07/02/arreglos-kotlin/
val nombres = arrayOf("John Galt", "Dagny Taggart", "Hank Rearden")
for (nombre in nombres) {
println(nombre)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment