/**
 * This function appends a certain number of animals to a list based on their type.
 *
 * @param animalList The list containing the animals.
 * @param animalType The type of animal to add to the list.
 * @param numberOfAnimals The number of animals of the specified type to add to the list.
 * @return The updated animal list with the new animals added.
 */
fun addAnimalsToList(animalList: MutableList<String>, animalType: String, numberOfAnimals: Int): List<String> {

    if (animalType == "dog") {
        repeat(numberOfAnimals) {
            animalList.add("Dog")
        }
    } else if (animalType == "cat") {
        repeat(numberOfAnimals) {
            animalList.add("Cat")
        }
    } else if (animalType == "bird") {
        repeat(numberOfAnimals) {
            animalList.add("Bird")
        }
    } else {
        return listOf("Invalid animal type. Please choose from 'dog', 'cat', or 'bird'.")
    }
    
    return animalList
}

val animalList = mutableListOf<String>()
val animalType = "dog"
val numberOfAnimals = 3

// Your task is to complete the code below
val updatedAnimalList = addAnimalsToList(animalList, animalType, numberOfAnimals)
/**
 * This function appends a certain number of animals to a list based on their type.
 *
 * @param animalList The list containing the animals.
 * @param animalType The type of animal to add to the list.
 * @param numberOfAnimals The number of animals of the specified type to add to the list.
 * @return The updated animal list with the new animals added.
 */
fun addAnimalsToList(animalList: MutableList<String>, animalType: String, numberOfAnimals: Int): List<String> {
/**
 * This function appends a certain number of animals to a list based on their type.
 *
 * @param animalList The list containing the animals.
 * @param animalType The type of animal to add to the list.
 * @param numberOfAnimals The number of animals of the specified type to add to the list.
 * @return The updated animal list with the new animals added.
 */
fun addAnimalsToList(animalList: MutableList<String>, animalType: String, numberOfAnimals: Int): List<String> {

    if (animalType == "dog") {
        repeat(numberOfAnimals) {
            animalList.add("Dog")
        }
    } else if (animalType == "cat") {
        repeat(numberOfAnimals) {
            animalList.add("Cat")
        }
    } else if (animalType == "bird") {
        repeat(numberOfAnimals) {
            animalList.add("Bird")
        }
    } else {
        return listOf("Invalid animal type. Please choose from 'dog', 'cat', or 'bird'.")
    }
    
    return animalList
}

val animalList = mutableListOf<String>()
val animalType = "dog"
val numberOfAnimals = 3

// Your task is to complete the code below
val updatedAnimalList = addAnimalsToList(animalList, animalType, numberOfAnimals)