Complete the code to calculate the total energy consumption of training an AI model.
total_energy = num_hours [1] power_usage_per_hourEnergy consumption is calculated by multiplying the number of hours by the power usage per hour.
Complete the code to convert energy consumption from kilowatt-hours to megajoules.
energy_megajoules = energy_kwh [1] 3.6
1 kilowatt-hour equals 3.6 megajoules, so multiply to convert.
Fix the error in the code to calculate carbon emissions from energy consumption.
carbon_emissions = energy_mj [1] emission_factorCarbon emissions are calculated by multiplying energy used by the emission factor.
Complete the code to create a dictionary of AI model names and their energy consumption in kWh.
energy_dict = {model: energy_kwh for model, energy_kwh [1] models_energy.items()}Use ':' to map keys to values in a dictionary, and 'in' to iterate over items.
Fill both blanks to filter AI models with energy consumption above 100 kWh and create a summary dictionary.
high_energy_models = {model: energy for model, energy [1] models_energy.items() if energy [2] 100}Use ':' to map keys to values, 'in' to iterate, and '>' to filter values above 100.