def fatorial_range(n):
""" Retorna o fatorial de todos os números entre 1 e n """
next_value = 1
for i in range(1, n+1):
yield next_value
next_value *= i + 1
for fat in fatorial_range(5):
print(fat)
ZGVmIGZhdG9yaWFsX3JhbmdlKG4pOgogICAgIiIiIFJldG9ybmEgbyBmYXRvcmlhbCBkZSB0b2RvcyBvcyBuw7ptZXJvcyBlbnRyZSAxIGUgbiAiIiIKICAgIG5leHRfdmFsdWUgPSAxCiAgICBmb3IgaSBpbiByYW5nZSgxLCBuKzEpOgogICAgICAgIHlpZWxkIG5leHRfdmFsdWUKICAgICAgICBuZXh0X3ZhbHVlICo9IGkgKyAxCiAgICAgICAgCmZvciBmYXQgaW4gZmF0b3JpYWxfcmFuZ2UoNSk6CiAgICBwcmludChmYXQp