/**
 * Given a string containing information about an animal, extract and return certain attributes.
 *
 * @param animal A string in the format 'name:age:species:color:habitat' representing an animal.
 * @return A tuple containing the name, age, species, color, and habitat of the animal.
 *
 * Example:
 * getAnimalAttributes("Lion:8:Panthera leo:golden:grassland") => ('Lion', '8', 'Panthera leo', 'golden', 'grassland')
 */
fun getAnimalAttributes(animal: String): List<String> {

    // Split the animal string at every colon to extract the attributes
    val (name, age, species, color, habitat) = animal.split(':')

    // Return the attributes as a list
    return listOf(name, age, species, color, habitat)
}
/**
 * Given a string containing information about an animal, extract and return certain attributes.
 *
 * @param animal A string in the format 'name:age:species:color:habitat' representing an animal.
 * @return A tuple containing the name, age, species, color, and habitat of the animal.
 *
 * Example:
 * getAnimalAttributes("Lion:8:Panthera leo:golden:grassland") => ('Lion', '8', 'Panthera leo', 'golden', 'grassland')
 */
fun getAnimalAttributes(animal: String): List<String> {
/**
 * Given a string containing information about an animal, extract and return certain attributes.
 *
 * @param animal A string in the format 'name:age:species:color:habitat' representing an animal.
 * @return A tuple containing the name, age, species, color, and habitat of the animal.
 *
 * Example:
 * getAnimalAttributes("Lion:8:Panthera leo:golden:grassland") => ('Lion', '8', 'Panthera leo', 'golden', 'grassland')
 */
fun getAnimalAttributes(animal: String): List<String> {

    // Split the animal string at every colon to extract the attributes
    val (name, age, species, color, habitat) = animal.split(':')

    // Return the attributes as a list
    return listOf(name, age, species, color, habitat)
}