/**
 * This exercise focuses on creating a tuple using the tuple() function and implementing the else statement.
 * You need to complete the code section where the tuple is created and handle the case when the age of the astronomer is negative.
 * The astronomer's name and age will be provided as arguments to the function.
 *
 * @param astronomerName The name of the astronomer.
 * @param age The age of the astronomer.
 * @return A tuple containing the astronomer's name and age, if age is not negative. Otherwise, it should return null.
 *
 * Example:
 * createTuple("Galileo", 46)
 * Output: ("Galileo", 46)
 *
 * createTuple("Hubble", -34)
 * Output: null
 */
fun createTuple(astronomerName: String, age: Int): Pair<String, Int>? {

    val astronomerTuple: Pair<String, Int>? = if (age >= 0) {
        Pair(astronomerName, age)
    } else {
        null
    }
    return astronomerTuple
}

// Example usage
/**
 * This exercise focuses on creating a tuple using the tuple() function and implementing the else statement.
 * You need to complete the code section where the tuple is created and handle the case when the age of the astronomer is negative.
 * The astronomer's name and age will be provided as arguments to the function.
 *
 * @param astronomerName The name of the astronomer.
 * @param age The age of the astronomer.
 * @return A tuple containing the astronomer's name and age, if age is not negative. Otherwise, it should return null.
 *
 * Example:
 * createTuple("Galileo", 46)
 * Output: ("Galileo", 46)
 *
 * createTuple("Hubble", -34)
 * Output: null
 */
fun createTuple(astronomerName: String, age: Int): Pair<String, Int>? {
/**
 * This exercise focuses on creating a tuple using the tuple() function and implementing the else statement.
 * You need to complete the code section where the tuple is created and handle the case when the age of the astronomer is negative.
 * The astronomer's name and age will be provided as arguments to the function.
 *
 * @param astronomerName The name of the astronomer.
 * @param age The age of the astronomer.
 * @return A tuple containing the astronomer's name and age, if age is not negative. Otherwise, it should return null.
 *
 * Example:
 * createTuple("Galileo", 46)
 * Output: ("Galileo", 46)
 *
 * createTuple("Hubble", -34)
 * Output: null
 */
fun createTuple(astronomerName: String, age: Int): Pair<String, Int>? {

    val astronomerTuple: Pair<String, Int>? = if (age >= 0) {
        Pair(astronomerName, age)
    } else {
        null
    }
    return astronomerTuple
}

// Example usage