def getMedian(nums):
    """ Calculate median of a given set of values.
        Arguments:
            nums            An iterable of numbers.
        Returns:
            median          The median of the given values.
    """
    nums = sorted(nums)
    if len(nums) % 2 == 1:
        return nums[((len(nums)+1) // 2) - 1]
    else:
        return float(sum(nums[(len(nums)//2)-1:(len(nums)//2)+1])) / 2.0