/**
 * This function receives a list of devices and a power source. It appends the power source to each device in the list.
 *
 * @param devices a list of devices
 * @param powerSource the power source to append to each device
 * @return the updated list of devices with the power source appended
 *
 * Example:
 * devices = ['Lightbulb', 'Fan']
 * powerSource = 'Electricity'
 * addPowerToDevices(devices, powerSource) -> ['Lightbulb powered by Electricity', 'Fan powered by Electricity']
 */
fun addPowerToDevices(devices: List<String>, powerSource: String): List<String> {

    // Initialize an empty list to store the updated devices
    val updatedDevices = mutableListOf<String>()

    // Iterate over each device in the list
    for (device in devices) {
        // Append the power source to the device and add it to the updatedDevices list
        val updatedDevice = "$device powered by $powerSource"
        updatedDevices.add(updatedDevice)
    }

    return updatedDevices
}
/**
 * This function receives a list of devices and a power source. It appends the power source to each device in the list.
 *
 * @param devices a list of devices
 * @param powerSource the power source to append to each device
 * @return the updated list of devices with the power source appended
 *
 * Example:
 * devices = ['Lightbulb', 'Fan']
 * powerSource = 'Electricity'
 * addPowerToDevices(devices, powerSource) -> ['Lightbulb powered by Electricity', 'Fan powered by Electricity']
 */
fun addPowerToDevices(devices: List<String>, powerSource: String): List<String> {
/**
 * This function receives a list of devices and a power source. It appends the power source to each device in the list.
 *
 * @param devices a list of devices
 * @param powerSource the power source to append to each device
 * @return the updated list of devices with the power source appended
 *
 * Example:
 * devices = ['Lightbulb', 'Fan']
 * powerSource = 'Electricity'
 * addPowerToDevices(devices, powerSource) -> ['Lightbulb powered by Electricity', 'Fan powered by Electricity']
 */
fun addPowerToDevices(devices: List<String>, powerSource: String): List<String> {

    // Initialize an empty list to store the updated devices
    val updatedDevices = mutableListOf<String>()

    // Iterate over each device in the list
    for (device in devices) {
        // Append the power source to the device and add it to the updatedDevices list
        val updatedDevice = "$device powered by $powerSource"
        updatedDevices.add(updatedDevice)
    }

    return updatedDevices
}