class RingBuffer:
    def __init__(self, capacity):
        self.capacity = capacity
        self.current = 0
        self.storage = [None]*capacity

# if new element is inserted (+1), the oldest element in the ring buffer is overwritten (-1)
# with the newest element.
# compare storage with current storage
# if after current is added ( + 1 ) and if it's smaller than the capacity then add it
# (minus 1 because it gets taken out after one is inserted)
# otherwise

    def append(self, item):
        """append an element at the end of the buffer"""
        self.storage[self.current] = item
        if self.current < self.capacity - 1:
            self.current += 1
        else:
            self.current = 0


#  returns all of the elements in the buffer in a list in their given order.
# It should not return any None values in the list even if they are present in the ring buffer.
# get() should return [] an array
# initialize array, make a for loop to get items in storage,
# check to see if there are any items
# we're not getting any values that are None so, if there are items, then add (.append) to list of items


    def get(self):
        array = []
        for item in self.storage:
            if item != None:
                array.append(item)
        return array
