Solutions Python#
Task 1: What is 5 to the power of 5 minus 5?
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.
Task 3: Split the following string into a list by splitting on the space character:
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.
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.
Task 6: Write a function that converts units of energy from ‘ktoe’ to ‘GWh’
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’.
Note
You can also just pick three units to convert between if you don’t feel like going through all combinations.