Re-sizes the `Array` by appending new *array elements* or
        removing *array elements* from the end.

        :param int capacity: new capacity of the `Array` in number of *array elements*.

def resize(self, capacity):
        """ Re-sizes the `Array` by appending new *array elements* or
        removing *array elements* from the end.

        :param int capacity: new capacity of the `Array` in number of *array elements*.
        """
        count = max(int(capacity), 0) - len(self)

        if count == 0:
            pass
        elif -count == len(self):
            self.clear()
        elif count > 0:
            for i in range(count):
                self.append()
        else:
            for i in range(abs(count)):
                self.pop()