0
0
Prompt Engineering / GenAIml~10 mins

Environmental impact of AI in Prompt Engineering / GenAI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to calculate the total energy consumption of training an AI model.

Prompt Engineering / GenAI
total_energy = num_hours [1] power_usage_per_hour
Drag options to blanks, or click blank then click option'
A+
B-
C*
D/
Attempts:
3 left
💡 Hint
Common Mistakes
Using addition instead of multiplication
Dividing instead of multiplying
2fill in blank
medium

Complete the code to convert energy consumption from kilowatt-hours to megajoules.

Prompt Engineering / GenAI
energy_megajoules = energy_kwh [1] 3.6
Drag options to blanks, or click blank then click option'
A*
B/
C-
D+
Attempts:
3 left
💡 Hint
Common Mistakes
Dividing instead of multiplying
Adding the conversion factor
3fill in blank
hard

Fix the error in the code to calculate carbon emissions from energy consumption.

Prompt Engineering / GenAI
carbon_emissions = energy_mj [1] emission_factor
Drag options to blanks, or click blank then click option'
A/
B+
C-
D*
Attempts:
3 left
💡 Hint
Common Mistakes
Using addition or division instead of multiplication
4fill in blank
hard

Complete the code to create a dictionary of AI model names and their energy consumption in kWh.

Prompt Engineering / GenAI
energy_dict = {model: energy_kwh for model, energy_kwh [1] models_energy.items()}
Drag options to blanks, or click blank then click option'
A:
Bin
Con
D=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' instead of ':' in dictionary
Using 'on' instead of 'in' for iteration
5fill in blank
hard

Fill both blanks to filter AI models with energy consumption above 100 kWh and create a summary dictionary.

Prompt Engineering / GenAI
high_energy_models = {model: energy for model, energy [1] models_energy.items() if energy [2] 100}
Drag options to blanks, or click blank then click option'
A:
Bin
C>
D=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' instead of ':' in dictionary
Using '<' instead of '>' for filtering