human
Write me a code to 12 given the following:
12. reversed"
Please write code following the instructions in jupyter notebook style.
assistant
#Here is code to 12.

#iterates in reverse
a = [1, 2, 3, 4]
for x in reversed(a):
    print(x)

#you can customize the behavior of reversed for your class by implementing __reversed()__ method
class Counter:
    def __init__(self, start):
        self.start = start
    # Forward iterator
    def __iter__(self):
        n = 1
        while n <= self.start:
            yield n
            n += 1
    # Reverse iterator
    def __reversed__(self):
        n = self.start
        while n > 0:
            yield n
            n -= 1

foo = Counter(5)
for x in reversed(foo):
    print(x)