/**
 * This function takes an animal as input and returns its habitat using nested ternary operators in Kotlin.
 */
fun animalHabitat(animal: String): String {

    return when (animal) {
        in listOf("tiger", "lion", "leopard") -> "forest"
        in listOf("whale", "dolphin", "shark") -> "ocean"
        in listOf("monkey", "elephant", "gorilla") -> "jungle"
        in listOf("camel", "snake", "scorpion") -> "desert"
        in listOf("polar bear", "penguin", "walrus") -> "arctic"
        else -> "unknown"
    }
}
/**
 * This function takes an animal as input and returns its habitat using nested ternary operators in Kotlin.
 */
fun animalHabitat(animal: String): String {
/**
 * This function takes an animal as input and returns its habitat using nested ternary operators in Kotlin.
 */
fun animalHabitat(animal: String): String {

    return when (animal) {
        in listOf("tiger", "lion", "leopard") -> "forest"
        in listOf("whale", "dolphin", "shark") -> "ocean"
        in listOf("monkey", "elephant", "gorilla") -> "jungle"
        in listOf("camel", "snake", "scorpion") -> "desert"
        in listOf("polar bear", "penguin", "walrus") -> "arctic"
        else -> "unknown"
    }
}