Estimates the height of the son/daughter by doing the sum of dad_height and mom_height and dividing it by 2
the first digit is the feet and the second inches
If its a boy add 5 inches
If its a girl subtract 5 inches
def est_height(gender, dad_height, mom_height):
if gender=="boy":
return ((dad_height + mom_height)/2)+0.5
else:
return ((dad_height + mom_height)/2)-0.5
import codewars_test as test
# TODO Write tests
import solution # or from solution import example
# test.assert_equals(actual, expected, [optional] message)
@test.describe("Example")
def test_group():
@test.it("test case")
def test_examples():
test.assert_equals(est_height("boy", 6.4, 6.8), 7.1)
test.assert_equals(est_height("girl", 5.7, 4.7), 4.7)