/**
 * This exercise is about checking if a carpenter's name is in a list of member names and using a for loop to iterate over the characters of a string.
 *
 * Your task is to write a function that takes in two arguments: 'members' - a list of names (strings) and 'carpenter' - the name of a carpenter (string). The function should return True if the carpenter's name is present in the list of member names, and False otherwise. Additionally, the function should use a for loop to iterate over the characters of the carpenter's name and print each character on a new line.
 *
 * Example:
 * name(listOf("John", "Alex", "Mary"), "Alex")
 * Output:
 * true
 * A
 * l
 * e
 * x
 */
fun name(members: List<String>, carpenter: String) {

    // Checking if carpenter's name is in the list of member names
    if (carpenter in members) {
        println(true)
    } else {
        println(false)
    }

    // Using a for loop to iterate over the characters of the carpenter's name
    for (character in carpenter) {
        println(character)
    }
}
/**
 * This exercise is about checking if a carpenter's name is in a list of member names and using a for loop to iterate over the characters of a string.
 *
 * Your task is to write a function that takes in two arguments: 'members' - a list of names (strings) and 'carpenter' - the name of a carpenter (string). The function should return True if the carpenter's name is present in the list of member names, and False otherwise. Additionally, the function should use a for loop to iterate over the characters of the carpenter's name and print each character on a new line.
 *
 * Example:
 * name(listOf("John", "Alex", "Mary"), "Alex")
 * Output:
 * true
 * A
 * l
 * e
 * x
 */
fun name(members: List<String>, carpenter: String) {
/**
 * This exercise is about checking if a carpenter's name is in a list of member names and using a for loop to iterate over the characters of a string.
 *
 * Your task is to write a function that takes in two arguments: 'members' - a list of names (strings) and 'carpenter' - the name of a carpenter (string). The function should return True if the carpenter's name is present in the list of member names, and False otherwise. Additionally, the function should use a for loop to iterate over the characters of the carpenter's name and print each character on a new line.
 *
 * Example:
 * name(listOf("John", "Alex", "Mary"), "Alex")
 * Output:
 * true
 * A
 * l
 * e
 * x
 */
fun name(members: List<String>, carpenter: String) {

    // Checking if carpenter's name is in the list of member names
    if (carpenter in members) {
        println(true)
    } else {
        println(false)
    }

    // Using a for loop to iterate over the characters of the carpenter's name
    for (character in carpenter) {
        println(character)
    }
}