Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3.2.2
- ## -*- coding: utf-8 -*-
- # Module To Read & Write The Fibonacci Series Up To "n".
- __file_name__ = 'fibtest.py'
- __author__ = 'Dan Evans'
- __copyright__ = 'Copyright 2012©, Coding With Py'
- __credits__ = 'Dan Evans'
- __dct_url__ = 'http://purl.org/dc/terms/'
- __license__ = 'Creative Commons'
- __rel_url__ = 'http://creativecommons.org/licenses/by-nc/4.0/'
- __version__ = 'CC-by-nc/4.0/'
- __maintainer__ = 'Dan(Python253)Evans'
- __email__ = 'Python253@gmail.com'
- print('\n','','fibtest.py is licensed under',
- 'The Creative Commons Attribution-NonCommercial 4.0 International License',
- '\n'*2,'File Name: '+__file_name__,'\n','Author: '+__author__,
- '\n','Copyright: '+__copyright__,'\n','Credits: '+__credits__,
- '\n','DCT URL: ','\n',__dct_url__,'\n','License: '+__license__,
- '\n','Release URL: ','\n',__rel_url__,'\n','Version: '+__version__,
- '\n','Maintainer: '+__maintainer__,'\n','Email: '+__email__,'\n')
- # Fibonacci numbers module
- def fib(n): # write Fibonacci series up to n
- a, b = 0, 1
- while b < n:
- print b,
- a, b = b, a+b
- def fib2(n): # return Fibonacci series up to n
- result = []
- a, b = 0, 1
- while b < n:
- result.append(b)
- a, b = b, a
- return result
- #End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement