val myList:MutableList<Int> = mutableListOf("Bob", "Mary", "Lemon", "Alex", "Sarah")
println("Searching for a person named Alex")
var found = false
for (currItem in myList) {
if (currItem == "Alex") {
println("Item found!")
// set found to true
found = true
// exit because there's no need to keep searching
break
}
}
// decide on the results
if (found == true) {
println("Item found")
}
else {
println("Not found")
}