/**
 * Create a dictionary for a farmer that includes information about their names, ages, crops, and animals.
 *
 * @param names A list of strings representing the names of the farmers.
 * @param ages A list of integers representing the ages of the farmers.
 * @param crops A list of strings representing the crops harvested by the farmers.
 * @param animals A list of strings representing the animals owned by the farmers.
 * @return A dictionary with the farmer's information.
 */
fun createFarmersDictionary(names: List<String>, ages: List<Int>, crops: List<String>, animals: List<String>): Map<String, Map<String, Any>> {

    // Initialize an empty dictionary
    val farmerDict = mutableMapOf<String, Map<String, Any>>()

    // Iterate over the lists using the indices
    for (i in names.indices) {
        // Create a nested dictionary for each farmer
        farmerDict[names[i]] = mapOf(
            "age" to ages[i],
            "crops" to crops[i],
            "animals" to animals[i]
        )
    }

    return farmerDict
}

// Example usage
val names = listOf("John", "Sarah", "Michael")
val ages = listOf(45, 32, 56)
val crops = listOf("corn", "tomato", "wheat")
val animals = listOf("cow", "chicken")
val farmerDictionary = createFarmersDictionary(names, ages, crops, animals)
/**
 * Create a dictionary for a farmer that includes information about their names, ages, crops, and animals.
 *
 * @param names A list of strings representing the names of the farmers.
 * @param ages A list of integers representing the ages of the farmers.
 * @param crops A list of strings representing the crops harvested by the farmers.
 * @param animals A list of strings representing the animals owned by the farmers.
 * @return A dictionary with the farmer's information.
 */
fun createFarmersDictionary(names: List<String>, ages: List<Int>, crops: List<String>, animals: List<String>): Map<String, Map<String, Any>> {
/**
 * Create a dictionary for a farmer that includes information about their names, ages, crops, and animals.
 *
 * @param names A list of strings representing the names of the farmers.
 * @param ages A list of integers representing the ages of the farmers.
 * @param crops A list of strings representing the crops harvested by the farmers.
 * @param animals A list of strings representing the animals owned by the farmers.
 * @return A dictionary with the farmer's information.
 */
fun createFarmersDictionary(names: List<String>, ages: List<Int>, crops: List<String>, animals: List<String>): Map<String, Map<String, Any>> {

    // Initialize an empty dictionary
    val farmerDict = mutableMapOf<String, Map<String, Any>>()

    // Iterate over the lists using the indices
    for (i in names.indices) {
        // Create a nested dictionary for each farmer
        farmerDict[names[i]] = mapOf(
            "age" to ages[i],
            "crops" to crops[i],
            "animals" to animals[i]
        )
    }

    return farmerDict
}

// Example usage
val names = listOf("John", "Sarah", "Michael")
val ages = listOf(45, 32, 56)
val crops = listOf("corn", "tomato", "wheat")
val animals = listOf("cow", "chicken")
val farmerDictionary = createFarmersDictionary(names, ages, crops, animals)