Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Solutions Python

Technische Universität Berlin

Task 1: What is 5 to the power of 5 minus 5?

Notebook Cell
3120

Task 2: Create variables for the efficiency of 45% and the input_energy of 1000 MWh. Compute and print the output_energy using these variables.

Notebook Cell
450.0

Task 3: Split the following string into a list by splitting on the space character:

Notebook Cell
['Data', 'Science', 'for', 'Energy', 'System', 'Modelling']

Task 4: Create a list with the names of every planet in the solar system (in order).

  • Have Python tell you the name of the third planet.

  • Have Python tell you the total number of planets.

  • Have Python tell you whether “Pluto” is in the list of planets.

  • Iterate through your planets and print the planet name only if it has an “s” at the end.

Notebook Cell
Notebook Cell
'Earth'
Notebook Cell
8
Notebook Cell
Venus
Mars
Uranus

Task 5: Create a dictionary that contains the main facts about the Reuter West power plant.

  • Have Python tell you the main fuel type used in the power plant.

  • Add the power plant’s approximate latitude and longitude to the dictionary.

Notebook Cell
Notebook Cell
'Hard coal'
Notebook Cell

Task 6: Write a function that converts units of energy from ‘ktoe’ to ‘GWh’

https://www.iea.org/data-and-statistics/data-tools/unit-converter

Notebook Cell

Task 7: Write a more general unit conversion function that converts between all units of energy listed under the link below. The function should take arguments: for the original value, the original unit and the target unit. Implement the function in a way that the default target unit is “Wh”. Verify that function by converting 200 ‘toe’ to ‘Wh’.

https://www.iea.org/data-and-statistics/data-tools/unit-converter

Notebook Cell
Notebook Cell
Notebook Cell
13267727999.999998