/**
 * This exercise challenges you to correctly access tuple elements and handle None in conditional statements.
 *
 * Given a tuple representing a dancer, containing their name, age, and favorite dance style,
 * complete the code to perform the following tasks:
 * 1. Check if the name of the dancer is None. If so, return "Unknown name".
 * 2. Check if the age of the dancer is within the valid range of 18 to 30 (inclusive).
 *    If not, return "Invalid age".
 * 3. Check if the favorite dance style is None. If so, return "Unknown style".
 * 4. If none of the above conditions are met, return "Dancer's information is valid".
 *
 * You need to access the tuple elements using indexing.
 *
 * @param dancer A tuple containing the dancer's name, age, and favorite dance style.
 * @return A string indicating the validity of the dancer's information.
 */
fun accessDancer(dancer: Triple<String?, Int?, String?>): String {

    // Accessing tuple elements and handling None in conditional statements
    if (dancer.first == null) {  // Check if the name of the dancer is None
        return "Unknown name"
    } else if (dancer.second !in 18..30) {  // Check if the age of the dancer is within the valid range
        return "Invalid age"
    } else if (dancer.third == null) {  // Check if the favorite dance style is None
        return "Unknown style"
    }
    return "Dancer's information is valid"
}
/**
 * This exercise challenges you to correctly access tuple elements and handle None in conditional statements.
 *
 * Given a tuple representing a dancer, containing their name, age, and favorite dance style,
 * complete the code to perform the following tasks:
 * 1. Check if the name of the dancer is None. If so, return "Unknown name".
 * 2. Check if the age of the dancer is within the valid range of 18 to 30 (inclusive).
 *    If not, return "Invalid age".
 * 3. Check if the favorite dance style is None. If so, return "Unknown style".
 * 4. If none of the above conditions are met, return "Dancer's information is valid".
 *
 * You need to access the tuple elements using indexing.
 *
 * @param dancer A tuple containing the dancer's name, age, and favorite dance style.
 * @return A string indicating the validity of the dancer's information.
 */
fun accessDancer(dancer: Triple<String?, Int?, String?>): String {
/**
 * This exercise challenges you to correctly access tuple elements and handle None in conditional statements.
 *
 * Given a tuple representing a dancer, containing their name, age, and favorite dance style,
 * complete the code to perform the following tasks:
 * 1. Check if the name of the dancer is None. If so, return "Unknown name".
 * 2. Check if the age of the dancer is within the valid range of 18 to 30 (inclusive).
 *    If not, return "Invalid age".
 * 3. Check if the favorite dance style is None. If so, return "Unknown style".
 * 4. If none of the above conditions are met, return "Dancer's information is valid".
 *
 * You need to access the tuple elements using indexing.
 *
 * @param dancer A tuple containing the dancer's name, age, and favorite dance style.
 * @return A string indicating the validity of the dancer's information.
 */
fun accessDancer(dancer: Triple<String?, Int?, String?>): String {

    // Accessing tuple elements and handling None in conditional statements
    if (dancer.first == null) {  // Check if the name of the dancer is None
        return "Unknown name"
    } else if (dancer.second !in 18..30) {  // Check if the age of the dancer is within the valid range
        return "Invalid age"
    } else if (dancer.third == null) {  // Check if the favorite dance style is None
        return "Unknown style"
    }
    return "Dancer's information is valid"
}