human
I am working on the file "Iterable object.ipynb".
The first task is:
Creating iterable object
Iterable object can be defined using class.
Can you write Python code for it?
assistant
#Here is the Python code you requested.

class Reverse:
    """Iterator for looping over a sequence backwards."""
    def __init__(self, data):
        self.data = data
        self.index = len(data)

    def __iter__(self):
        return self

    def __next__(self):
        if self.index == 0:
            raise StopIteration
        self.index = self.index - 1
        return self.data[self.index]

rev = Reverse('UCSY')
for c in rev:
    print(c)
    
print('---')
    
rev = Reverse([100, 200, 300])
for c in rev:
    print(c)