Question: This is a start to the code I am supposed to write. The image of the list of tuples was too big to share, but
This is a start to the code I am supposed to write. The image of the list of tuples was too big to share, but the list containing the tupelo of the form (year, population) is called MIDYEAR_POPULATION, the list is below. Please help me get started!!!
MIDYEAR_POPULATION = [(1971, 21962032), (1972, 22218463), (1973, 22491777), (1974, 22807969), (1975, 23143275), (1976, 23449808), (1977, 23725843), (1978, 23963203), (1979, 24201544), (1980, 24515667), (1981, 24819915), (1982, 25116942), (1983, 25366451), (1984, 25607053), (1985, 25842116), (1986, 26100278), (1987, 26446601), (1988, 26791747), (1989, 27276781), (1990, 27691138), (1991, 28037420), (1992, 28371264), (1993, 28684764), (1994, 29000663), (1995, 29302311), (1996, 29610218), (1997, 29905948), (1998, 30155173), (1999, 30401286), (2000, 30685730), (2001, 31020596), (2002, 31358418), (2003, 31641630), (2004, 31938004), (2005, 32242364), (2006, 32570505), (2007, 32887928), (2008, 33245773), (2009, 33628571), (2010, 34005274), (2011, 34342780), (2012, 34750545), (2013, 35152370), (2014, 35535348), (2015, 35832513), (2016, 36264604), (2017, 36708083)]
def greatest increase(pop stats) function: qreatest increase Given a list of tuples of the form (year, population), the function finds the year for which is recorded the greatest increase in population from the previous year. Input: * pop stats: A list of tuples of the form (year, population) The tuples are sorted by year, and there are no gaps between years OutputS: *A pair of values consisting of the year with the greatest population increase, and the amount of that increase. return 0, 0 def main): year, increase greatest increase (MIDYEAR POPULATION ) print( "Greatest increase: ", year, increase) year, increase smallest_increase(MIDYEAR_POPULATION) print("Smallest increase: ", year, increase) average = average-percentage-increase ( MIDYEAR POPULATION) print ("Average percentage increase: ", format ( average, ".2f"), "%", sep="") main(
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
