# Usually you would have to create list to store the numbers
# Generators are good for large data


def gencubes(n):
    for num in range(n):
        yield num**3

for x in gencubes(10):
    print(x)

def genfibon(n):
    a = 1
    b = 1
    for i in range(n):
        yield a
        a, b = b, a + b

for num in genfibon(10):
    print(num)

def fibon(n):
    a = 1
    b = 1

    output = []

    for i in range(n):
        output.append(a)
        a, b = b, a+b
    return output

print(fibon(10))

def simple_gen():
    for x in range(3):
        yield x

g = simple_gen()
print(next(g))
print(next(g))

s = 'hello'

for let in s:
    print(let)

s_iter = iter(s)
print(next(s_iter))
af752b3c391a1d0af023c22f211a476fc780e91a
def gencubes(n):
    for num in range(n):
        yield num ** 3


<mask token>


def simple_gen():
    for x in range(3):
        yield x


<mask token>

def gencubes(n):
    for num in range(n):
        yield num ** 3


<mask token>


def genfibon(n):
    a = 1
    b = 1
    for i in range(n):
        yield a
        a, b = b, a + b


<mask token>


def fibon(n):
    a = 1
    b = 1
    output = []
    for i in range(n):
        output.append(a)
        a, b = b, a + b
    return output


<mask token>


def simple_gen():
    for x in range(3):
        yield x


<mask token>

def gencubes(n):
    for num in range(n):
        yield num ** 3


for x in gencubes(10):
    print(x)


def genfibon(n):
    a = 1
    b = 1
    for i in range(n):
        yield a
        a, b = b, a + b


for num in genfibon(10):
    print(num)


def fibon(n):
    a = 1
    b = 1
    output = []
    for i in range(n):
        output.append(a)
        a, b = b, a + b
    return output


print(fibon(10))


def simple_gen():
    for x in range(3):
        yield x


<mask token>
print(next(g))
print(next(g))
<mask token>
for let in s:
    print(let)
<mask token>
print(next(s_iter))

def gencubes(n):
    for num in range(n):
        yield num ** 3


for x in gencubes(10):
    print(x)


def genfibon(n):
    a = 1
    b = 1
    for i in range(n):
        yield a
        a, b = b, a + b


for num in genfibon(10):
    print(num)


def fibon(n):
    a = 1
    b = 1
    output = []
    for i in range(n):
        output.append(a)
        a, b = b, a + b
    return output


print(fibon(10))


def simple_gen():
    for x in range(3):
        yield x


g = simple_gen()
print(next(g))
print(next(g))
s = 'hello'
for let in s:
    print(let)
s_iter = iter(s)
print(next(s_iter))

# Usually you would have to create list to store the numbers
# Generators are good for large data


def gencubes(n):
    for num in range(n):
        yield num**3

for x in gencubes(10):
    print(x)

def genfibon(n):
    a = 1
    b = 1
    for i in range(n):
        yield a
        a, b = b, a + b

for num in genfibon(10):
    print(num)

def fibon(n):
    a = 1
    b = 1

    output = []

    for i in range(n):
        output.append(a)
        a, b = b, a+b
    return output

print(fibon(10))

def simple_gen():
    for x in range(3):
        yield x

g = simple_gen()
print(next(g))
print(next(g))

s = 'hello'

for let in s:
    print(let)

s_iter = iter(s)
print(next(s_iter))