/**
 * This exercise requires modifying elements in a list and using dictionary methods.
 *
 * Modify the musician's list of instruments by adding a new instrument to it.
 * If the musician is already playing that instrument, do not add it again.
 *
 * @param musician A dictionary representing a musician, with the following keys:
 *                 - name: (String) the name of the musician.
 *                 - instruments: (MutableList<String>) a list of instruments the musician plays.
 * @param instrument The instrument to be added to the musician's list.
 */
fun addInstrument(musician: MutableMap<String, Any>, instrument: String) {

    if (instrument !in musician["instruments"] as MutableList<String>) {
        (musician["instruments"] as MutableList<String>).add(instrument)
    }
}
/**
 * This exercise requires modifying elements in a list and using dictionary methods.
 *
 * Modify the musician's list of instruments by adding a new instrument to it.
 * If the musician is already playing that instrument, do not add it again.
 *
 * @param musician A dictionary representing a musician, with the following keys:
 *                 - name: (String) the name of the musician.
 *                 - instruments: (MutableList<String>) a list of instruments the musician plays.
 * @param instrument The instrument to be added to the musician's list.
 */
fun addInstrument(musician: MutableMap<String, Any>, instrument: String) {
/**
 * This exercise requires modifying elements in a list and using dictionary methods.
 *
 * Modify the musician's list of instruments by adding a new instrument to it.
 * If the musician is already playing that instrument, do not add it again.
 *
 * @param musician A dictionary representing a musician, with the following keys:
 *                 - name: (String) the name of the musician.
 *                 - instruments: (MutableList<String>) a list of instruments the musician plays.
 * @param instrument The instrument to be added to the musician's list.
 */
fun addInstrument(musician: MutableMap<String, Any>, instrument: String) {

    if (instrument !in musician["instruments"] as MutableList<String>) {
        (musician["instruments"] as MutableList<String>).add(instrument)
    }
}