//Bucles
fun bucle(){
val myArray:List<String> = listOf("Hola" , "Bienvenido al tutorial", "Suscribete")
val myMap:MutableMap<String,Int> = mutableMapOf("Brais" to 1, "Pedro" to 2, "Sara" to 5)
//Bucles: for y while
//Imprimiendo el contenido del array con el bucle for
for (myString: String in myArray){
println(myString)
}
//Imprimiendo el contenido del mapa con el bucle for
for (myElement:MutableMap.MutableEntry<String, Int> in myMap){
println(myElement.value)
}
for (x in 0..30 step 3){
println(x)
}
for (x in 20 downTo 0 step 2){
println(x)
}
//Buble while
var x = 0
while (x < 10){
println(x)
x++
}
}