Assignment: Write a function that takes in the three attributes of a Simpson character and outputs the gender classification


In [2]:
def get_gender(hair, weight, age):
    if weight > 160:
        return 'M'
    elif hair < 3:
        return 'M'
    else:
        return 'F'

In [3]:
get_gender(8, 209, 38)


Out[3]:
'M'