import statistics def est_height(gender, dad_height, mom_height): avg = statistics.mean([dad_height, mom_height]) return avg + 0.5 if gender is "boy" else avg - 0.5
- import statistics
- def est_height(gender, dad_height, mom_height):
if gender is "boy":return statistics.mean([dad_height, mom_height]) + 0.5elif gender is "girl":return statistics.mean([dad_height, mom_height]) - 0.5- avg = statistics.mean([dad_height, mom_height])
- return avg + 0.5 if gender is "boy" else avg - 0.5