import statistics
def est_height(gender, dad_height, mom_height):
if gender == "boy":
return (dad_height + mom_height)/2 + 0.5
elif gender == "girl":
return (dad_height + mom_height)/2 - 0.5
import statistics def est_height(gender, dad_height, mom_height): if gender is "boy": return statistics.mean([dad_height, mom_height]) + 0.5 elif gender is "girl": return statistics.mean([dad_height, mom_height]) - 0.5
- import statistics
- def est_height(gender, dad_height, mom_height):
SPEEDOFLIGHT = 299792458MODIFIER = 0.5boy_height = statistics.mean([dad_height, mom_height]) + (SPEEDOFLIGHT * (MODIFIER / SPEEDOFLIGHT))girl_height = statistics.mean([dad_height, mom_height]) - (SPEEDOFLIGHT * (MODIFIER / SPEEDOFLIGHT))- if gender is "boy":
return boy_height- return statistics.mean([dad_height, mom_height]) + 0.5
- elif gender is "girl":
return girl_height- return statistics.mean([dad_height, mom_height]) - 0.5