Make a module that will hold the PopulationGroup class and related…
Question Answered step-by-step Make a module that will hold the PopulationGroup class and related… Make a module that will hold the PopulationGroup class and related test code. This exercise will be creating the PopulationGroup class and conducting a unit test.The requirements for the PopulationGroup class include the following:An __init__ constructor that allows all instance variables to be set.An instance variable category that is expected to hold a string.An instance variable male_count that is expected to hold an int.An instance variable female_count this expected to hold an int.An instance variable total_count this expected to hold an int.A method calculate_category_percent that is expected to return a float.Hint. calculate_category_percent = (total_count / grand_total) * 100The module should also contain a main() function that contains the unit test code for the PopulationGroup class.HERE ARE THE CONTENTS TO USE-Age Group Males Females Total0-14 97,680 93,991 191,67115-19 32,840 32,479 65,31920-24 38,953 41,206 80,15925-29 36,775 38,205 74,98030-34 37,072 39,197 76,26935-39 30,337 31,464 61,80140-44 28,176 29,271 57,44745-54 57,519 60,283 117,80255-64 52,893 57,669 110,56265-74 28,577 34,212 62,78975-84 13,743 20,822 34,56585+ 5,775 12,843 18,618Total 460,340 491,642 951,982 When this program is run directly (rather than having been imported), the console session should contain the unit testing output and should look like this: Unit testing output follows…Testing the constructor:40-4428,17629,27157,447Testing the calculate_category_percentage method:6.034462836482202 Computer Science Engineering & Technology Python Programming INFOST 350-201 Share QuestionEmailCopy link Comments (0)


