/**
 * This exercise focuses on using the index() method to loop through a dictionary and
 * calculate the total number of animals in a farmer's inventory.
 * The farmer has a dictionary where the keys represent the types of animals
 * and the values represent the quantity of each animal.
 * Your task is to complete the code to calculate and return the total number of animals on the farm.
 */
fun farmInventory(farmer: Map<String, Int>): Int {

    var totalAnimals = 0

    for ((_, quantity) in farmer) {
        totalAnimals += quantity
    }

    return totalAnimals
}
/**
 * This exercise focuses on using the index() method to loop through a dictionary and
 * calculate the total number of animals in a farmer's inventory.
 * The farmer has a dictionary where the keys represent the types of animals
 * and the values represent the quantity of each animal.
 * Your task is to complete the code to calculate and return the total number of animals on the farm.
 */
fun farmInventory(farmer: Map<String, Int>): Int {
/**
 * This exercise focuses on using the index() method to loop through a dictionary and
 * calculate the total number of animals in a farmer's inventory.
 * The farmer has a dictionary where the keys represent the types of animals
 * and the values represent the quantity of each animal.
 * Your task is to complete the code to calculate and return the total number of animals on the farm.
 */
fun farmInventory(farmer: Map<String, Int>): Int {

    var totalAnimals = 0

    for ((_, quantity) in farmer) {
        totalAnimals += quantity
    }

    return totalAnimals
}