Answered step by step
Verified Expert Solution
Question
1 Approved Answer
These are my codes and I would like them to have results like following: I think I am missing some codes but not sure
from lee_jieun_my_population_groups import PopulationGroup def main(): # do build_population_group_list population = build_population_group_list() # do calculate_column_totals male_total, female_total, category calculate_column_totals(population) pop_group PopulationGroup(male_total, female_total, category) #sorts the population groups by age group population.sort(key= by_category) print() #print reaport heading print('{0:^50}'.format('Counts by Age Group')) print(' {0: 10}{2:>10}{3:>10}{4:>10}'.format('Age Group', 'Males', 'Females', 'Total', 'Percent')) # do print_report report print_report #sorts the population groups by total_count descending population.sort(key = by_total, reverse = True) print() # print reaport heading T print('{0:^50}'.format('Counts by + title)) print(' {0: 10}{2:>10}{3:>10}{4:>10}'.format('Age Group', 'Males', 'Females', 'Total', 'Percent')) # do print_report report print_report # sorts population groups by male_count descending population.sort(key = by_males, reverse True) = print() #print reaport heading print('{0:^50}'.format('Counts by + title)) print(' {0: 10}{2:>10}{3:>10}{4:>10}'.format('Age Group', 'Males', 'Females', 'Total', 'Percent')) # do print_report report print_report # sort population groups by female_count descending population.sort(key = by_females, reverse = True) print() #print reaport heading 1 print('{0:^50}'.format('Counts by + title)) print(' {0: 10}{2:>10}{3:>10}{4:>10}'.format('Age Group', 'Males', 'Females', 'Total', 'Percent')) # do print_report report print_report
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started