/**
 * Create a tuple for a photographer's information and provide options to append and remove elements.
 *
 * @param photographerName The name of the photographer.
 * @return A tuple containing the photographer's name and other optional elements.
 */
fun createPhotographerTuple(photographerName: String): Pair<String, MutableList<String>> {

    val photographerTuple = mutableListOf(photographerName)  // Initialize the tuple with the provided name

    while (true) {
        println("\n----------------------")
        println("Current Tuple: $photographerTuple")
        println("\nWhat do you want to do?")
        println("1. Append element to the tuple")
        println("2. Remove element from the tuple")
        println("3. Exit")

        when (readLine()) {
            "1" -> {
                print("Enter the element to append: ")
                val element = readLine() ?: ""
                photographerTuple.add(element)  // Append the element to the tuple
            }
            "2" -> {
                if (photographerTuple.size <= 1) {  // Cannot remove elements if only photographer's name is present
                    println("Sorry! The tuple must have at least one element.")
                } else {
                    print("Enter the index of the element to remove: ")
                    val index = readLine()?.toIntOrNull() ?: -1
                    if (index in 1 until photographerTuple.size) {
                        photographerTuple.removeAt(index)
                    } else {
                        println("Invalid index.")
                    }
                }
            }
            "3" -> return Pair(photographerTuple[0], photographerTuple)
            else -> println("Invalid choice. Please try again.")
        }
    }
}
/**
 * Create a tuple for a photographer's information and provide options to append and remove elements.
 *
 * @param photographerName The name of the photographer.
 * @return A tuple containing the photographer's name and other optional elements.
 */
fun createPhotographerTuple(photographerName: String): Pair<String, MutableList<String>> {
/**
 * Create a tuple for a photographer's information and provide options to append and remove elements.
 *
 * @param photographerName The name of the photographer.
 * @return A tuple containing the photographer's name and other optional elements.
 */
fun createPhotographerTuple(photographerName: String): Pair<String, MutableList<String>> {

    val photographerTuple = mutableListOf(photographerName)  // Initialize the tuple with the provided name

    while (true) {
        println("\n----------------------")
        println("Current Tuple: $photographerTuple")
        println("\nWhat do you want to do?")
        println("1. Append element to the tuple")
        println("2. Remove element from the tuple")
        println("3. Exit")

        when (readLine()) {
            "1" -> {
                print("Enter the element to append: ")
                val element = readLine() ?: ""
                photographerTuple.add(element)  // Append the element to the tuple
            }
            "2" -> {
                if (photographerTuple.size <= 1) {  // Cannot remove elements if only photographer's name is present
                    println("Sorry! The tuple must have at least one element.")
                } else {
                    print("Enter the index of the element to remove: ")
                    val index = readLine()?.toIntOrNull() ?: -1
                    if (index in 1 until photographerTuple.size) {
                        photographerTuple.removeAt(index)
                    } else {
                        println("Invalid index.")
                    }
                }
            }
            "3" -> return Pair(photographerTuple[0], photographerTuple)
            else -> println("Invalid choice. Please try again.")
        }
    }
}