from collections import deque

class MovingAverage(object):
    
    def __init__(self, size):
        """
        Initialize your data structure here.
        :type size: int
        """
        self.q = deque( maxlen=size)


    def next(self, val):
        """
        :type val: int
        :rtype: float
        """
        self.q.append(val)
        
        return (float (sum(self.q))/float (len(self.q)))
            

77b916bd7e4b3ec0700522015ea82cd9fa58b53a
<mask token>


class MovingAverage(object):
    <mask token>
    <mask token>

<mask token>


class MovingAverage(object):

    def __init__(self, size):
        """
        Initialize your data structure here.
        :type size: int
        """
        self.q = deque(maxlen=size)
    <mask token>

<mask token>


class MovingAverage(object):

    def __init__(self, size):
        """
        Initialize your data structure here.
        :type size: int
        """
        self.q = deque(maxlen=size)

    def next(self, val):
        """
        :type val: int
        :rtype: float
        """
        self.q.append(val)
        return float(sum(self.q)) / float(len(self.q))

from collections import deque


class MovingAverage(object):

    def __init__(self, size):
        """
        Initialize your data structure here.
        :type size: int
        """
        self.q = deque(maxlen=size)

    def next(self, val):
        """
        :type val: int
        :rtype: float
        """
        self.q.append(val)
        return float(sum(self.q)) / float(len(self.q))

from collections import deque

class MovingAverage(object):
    
    def __init__(self, size):
        """
        Initialize your data structure here.
        :type size: int
        """
        self.q = deque( maxlen=size)


    def next(self, val):
        """
        :type val: int
        :rtype: float
        """
        self.q.append(val)
        
        return (float (sum(self.q))/float (len(self.q)))
            
