/**
 * Given a dictionary of artist information and a field name, this function returns the corresponding value for that field.
 *
 * @param artistInfo A dictionary containing information related to an artist.
 * @param field The name of the field for which the value needs to be retrieved.
 * @return The value associated with the provided field name in the artistInfo dictionary.
 *
 * Example:
 * val artistInfo = mapOf("name" to "Pablo Picasso", "born" to 1881, "died" to 1973, "nationality" to "Spanish")
 * val fieldName = "died"
 * getArtistInfo(artistInfo, fieldName)
 * Output: 1973
 */
fun getArtistInfo(artistInfo: Map<String, Any>, field: String): Any {

    return artistInfo[field] ?: error("Field not found")
}
/**
 * Given a dictionary of artist information and a field name, this function returns the corresponding value for that field.
 *
 * @param artistInfo A dictionary containing information related to an artist.
 * @param field The name of the field for which the value needs to be retrieved.
 * @return The value associated with the provided field name in the artistInfo dictionary.
 *
 * Example:
 * val artistInfo = mapOf("name" to "Pablo Picasso", "born" to 1881, "died" to 1973, "nationality" to "Spanish")
 * val fieldName = "died"
 * getArtistInfo(artistInfo, fieldName)
 * Output: 1973
 */
fun getArtistInfo(artistInfo: Map<String, Any>, field: String): Any {
/**
 * Given a dictionary of artist information and a field name, this function returns the corresponding value for that field.
 *
 * @param artistInfo A dictionary containing information related to an artist.
 * @param field The name of the field for which the value needs to be retrieved.
 * @return The value associated with the provided field name in the artistInfo dictionary.
 *
 * Example:
 * val artistInfo = mapOf("name" to "Pablo Picasso", "born" to 1881, "died" to 1973, "nationality" to "Spanish")
 * val fieldName = "died"
 * getArtistInfo(artistInfo, fieldName)
 * Output: 1973
 */
fun getArtistInfo(artistInfo: Map<String, Any>, field: String): Any {

    return artistInfo[field] ?: error("Field not found")
}