#! /usr/bin/python
#Sequencia Fibonacci


def fib(max):
''' imprime a sequência de fibonacci
'''
    if max < 0:              # test for invalid argument
      print 'max must be >0' # diagnostic message
      return                 # kill generator
    a, b = 0, 1
    while a < max:
        yield a
        a, b = b, a+b