Given a list of numbers, write a python program that finds an index of an array element and its corresponding value.
my_list = [2,4,6,8,10]
def find_index_and_value(my_list):
    for i, num in enumerate(my_list):
        print("Element with index %d has value %d" % (i, num))

my_list = [2,4,6,8,10]
find_index_and_value(my_list)