Last active
June 6, 2020 09:19
-
-
Save gonzalodiaz/2fc216bc03b23866b9621cedfaa6aef4 to your computer and use it in GitHub Desktop.
PopulationFix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def population(self, year: int) -> int: | |
"""Obtain the population in the world for a given year. | |
:param year: Year of which the population wants to be known. | |
:returns: Population for that year. 0 if the year was not found. | |
""" | |
return self.yearly_population.get(year, 0) | |
def population_on_2020(self) -> int: | |
"""Obtain the population for 2020. | |
:returns: population for the year 2020. | |
""" | |
return self.population(2020) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment