You are given a string of numbers between 0-9. Find the average of these numbers and return it as a floored whole number (ie: no decimal places) written out as a string. Eg:
"zero nine five two" -> "four"
If the string is empty or includes a number greater than 9, return "n/a"
def average_string(s):
    n = 0
    dic = { 'zero'  : 0,
            'one'   : 1,
            'two'   : 2,
            'three' : 3,
            'four'  : 4,
            'five'  : 5,
            'six'   : 6,
            'seven' : 7,
            'eight' : 8,
            'nine'  : 9 }
            
    s = s.split(' ')
    for i in range(len(s)):
        if s[i] in dic: n += dic[s[i]]
        else: return "n/a"
    n //= len(s)
    for key in dic:
        if dic.get(key) == n:
            n = key
    return n
def average_string(s):
    n = 0
    dic = { 'zero'  : 0,
            'one'   : 1,
            'two'   : 2,
            'three' : 3,
            'four'  : 4,
            'five'  : 5,
            'six'   : 6,
            'seven' : 7,
            'eight' : 8,
            'nine'  : 9 }
            
    s = s.split(' ')
    for i in range(len(s)):
        if s[i] in dic: n += dic[s[i]]
        else: return "n/a"
    n //= len(s)
    for key in dic:
        if dic.get(key) == n:
            n = key
    return n