class RGB:

    def __init__(self):
        self.cores = ['red', 'green', 'blue'][::-1]

    def __iter__(self):
        return self

    def __next__(self):
        try:
            return self.cores.pop()
        except IndexError:
            raise StopIteration()


if __name__ == '__main__':
    cores = RGB()
    print(next(cores))
    print(next(cores))
    print(next(cores))
    try:
        print(next(cores))
    except StopIteration:
        print('Acabou!')
    for cor in RGB():
        print(cor)

4d7429a45a99037caa708cf4a9c58576e4f2059e
class RGB:

    def __init__(self):
        self.cores = ['red', 'green', 'blue'][::-1]
    <mask token>
    <mask token>


<mask token>

class RGB:

    def __init__(self):
        self.cores = ['red', 'green', 'blue'][::-1]
    <mask token>

    def __next__(self):
        try:
            return self.cores.pop()
        except IndexError:
            raise StopIteration()


<mask token>

class RGB:

    def __init__(self):
        self.cores = ['red', 'green', 'blue'][::-1]

    def __iter__(self):
        return self

    def __next__(self):
        try:
            return self.cores.pop()
        except IndexError:
            raise StopIteration()


<mask token>

class RGB:

    def __init__(self):
        self.cores = ['red', 'green', 'blue'][::-1]

    def __iter__(self):
        return self

    def __next__(self):
        try:
            return self.cores.pop()
        except IndexError:
            raise StopIteration()


if __name__ == '__main__':
    cores = RGB()
    print(next(cores))
    print(next(cores))
    print(next(cores))
    try:
        print(next(cores))
    except StopIteration:
        print('Acabou!')
    for cor in RGB():
        print(cor)
