Question: Your task here is to write a Python function that calculates the year ( as an integer ) one must be born by to have

Your task here is to write a Python function that calculates the year (as an integer) one must be born by to have lived through some fraction of all emissions, either land, fossil, or both.
Make a Python function named what_year() that takes two named arguments, fraction, for the fraction of cumulative CO2
we are interested in, and source, which can take on string values 'Fossil', 'Land', or 'Both'. Give defaults of 0.5 and Both for these arguments. Thus, you should declare your function like so:
def what_year(fraction =0.5, source = 'Both'):
This function should return the latest year one could be born in such that fraction of all CO2
from the indicated source was emitted in one's lifetime. So, for example, what_year(fraction =.5, source = 'Both') should return 1991.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!