':type nums: List[int]
:type k: int
:rtype: float'

def findMaxAverage(self, nums, k):

    total = 0
    for i in xrange(k):
        total += nums[i]
    result = total
    for i in xrange(k, len(nums)):
        total += (nums[i] - nums[(i - k)])
        result = max(result, total)
    return (float(result) / k)
