# Mastery test 1 - part 4

def average(numbers):
    """
    >>> average([4, 5, 1, 9, 13, 2, -6])
    4.0
    >>> average([9, 17, -5, 8])
    7.25
    """
    return float(sum(numbers))/len(numbers)

def convert_c_to_f(celsius):
    """
    Convert a temperature from Fahrenheit to Celsius.
    The formula is F = C * 9/5 + 32
    
    >>> convert_c_to_f(0)
    32
    >>> convert_c_to_f(100)
    212
    >>> convert_c_to_f(-40)
    -40
    >>> convert_c_to_f(12)
    54
    >>> convert_c_to_f(18)
    64
    >>> convert_c_to_f(-48)
    -54
    """
    return int(round(celsius * 9.0 / 5 + 32))

# Write a function, including the doctests, which performs the
# opposite conversion to the one above.  Make sure that you include
# half a dozen sensible test cases.
def convert_f_to_c(fahrenheit):
    """
    >>> convert_f_to_c(212)
    100
    >>> convert_f_to_c(32)
    0
    >>> convert_f_to_c(-40)
    -40
    >>> convert_f_to_c(36)
    2
    >>> convert_f_to_c(37)
    3
    >>> convert_f_to_c(38)
    3
    >>> convert_f_to_c(39)
    4
    """
    return int(round((fahrenheit - 32) * 5.0 / 9))

def is_divisible(x, y):
    """
    >>> is_divisible(12, 4)
    'Yes, 12 is divisible by 4'
    >>> is_divisible(7, 3)
    'No, 7 is not divisible by 3'
    """
    if x % y == 0:
        return 'Yes, ' + str(x) + ' is divisible by ' + str(y)
    else:
        return 'No, ' + str(x) + ' is not divisible by ' +str(y)

def score(numbers):
    """
    give the average of the numbers excluding the biggest and smallest one

    >>> score([2, 7, 9, 10, 13, 1, 5, 12])
    7.5
    >>> score([3, 7, 2.5, -4])
    2.75
    """
    numbers.remove(max(numbers))
    numbers.remove(min(numbers))
    return float(sum(numbers))/len(numbers)

if __name__ == '__main__':
    import doctest
    doctest.testmod(verbose=True)
