Create a program in Python that takes a collection of numbers as input and calculates their mean.
[1, 4, 6, 8, 12]
def calculate_mean(nums):
    mean = 0
    for num in nums:
        mean += num
    mean /= len(nums)
    return mean