Snippet Library
Browse | Submit A New Snippet | Create A Package
rank | |
| Type: Sample Code (HOWTO) |
Category: Math Functions |
| License: GNU General Public License |
Language: Python |
| Description: a code snippet for generators | |
Versions Of This Snippet:
| Snippet ID | Download Version | Date Posted | Author | Delete |
|---|---|---|---|---|
| 16 | 0.1 | 2006-02-21 12:10 | rank1cheng |
Download a raw-text version of this code by clicking on "Download Version"
Latest Snippet Version: 0.1
def fib(n): a, b = 0, 1 if a < n: yield a a, b = b, a+b
Submit a new version
You can submit a new version of this snippet if you have modified it and you feel it is appropriate to share with others..

