"Oops, try again. median() resulted in an error: global name 'numlist' is not defined".
This is the error i keep on getting. I have checked over the code a few times and havent figued it out yet.
def median(numbers): numlst =  # new list to hold input numbers for item in numbers: #Adding numbers to the new list numlst.append(item) median = 0 #empty variable for holding the median numlst.sort() #Sorting the list numlen = len(numlist) #getting the length of the list if numlen % 2 == 0: #Check if length is an even number i = numlen / 2.0 #get position of first element. round(i, 1) # round off to get whole number median = (numlist[i] + numlist[i - 1]) /2.0 else: if numlen % 2 != 0: #check if its an odd number i = round((numlen / 2.0), 1) median = numlst[i - 1] #get middle element return median