Create a program in Python to count the number of elements of a given list.
list = ['This', 'is', 'a', 'list']
def element_count(list):
    return len(list)

list = ['This', 'is', 'a', 'list']
print(element_count(list))