Write a function in Python which takes in a list of numbers and returns the most common element in the list.
mylist = [3, 8, 8, 2, 4]
def most_common(mylist):
    return max(set(mylist), key = mylist.count)