/**
 * This function takes in the kingdom, phylum, and class_method of an animal and returns the
 * corresponding group the animal belongs to.
 */
fun findAnimal(kingdom: String, phylum: String, classMethod: String): String {

    return when {
        kingdom == "Animalia" -> {
            when (phylum) {
                "Chordata" -> {
                    when (classMethod) {
                        "Mammalia" -> "Mammals"
                        "Reptilia" -> "Reptiles"
                        "Amphibia" -> "Amphibians"
                        "Aves" -> "Birds"
                        else -> "Unknown class"
                    }
                }
                else -> "Non-chordates"
            }
        }
        else -> "Non-animals"
    }
}
/**
 * This function takes in the kingdom, phylum, and class_method of an animal and returns the
 * corresponding group the animal belongs to.
 */
fun findAnimal(kingdom: String, phylum: String, classMethod: String): String {
/**
 * This function takes in the kingdom, phylum, and class_method of an animal and returns the
 * corresponding group the animal belongs to.
 */
fun findAnimal(kingdom: String, phylum: String, classMethod: String): String {

    return when {
        kingdom == "Animalia" -> {
            when (phylum) {
                "Chordata" -> {
                    when (classMethod) {
                        "Mammalia" -> "Mammals"
                        "Reptilia" -> "Reptiles"
                        "Amphibia" -> "Amphibians"
                        "Aves" -> "Birds"
                        else -> "Unknown class"
                    }
                }
                else -> "Non-chordates"
            }
        }
        else -> "Non-animals"
    }
}