Created
December 2, 2009 06:22
-
-
Save jkern/246994 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a good start. -- jkern | |
def fib(): | |
"""A generator for Fibonacci numbers,that goes to the next number and adds it to the current""" | |
x = 0 | |
y = 1 | |
counter = 0 | |
#while 1: # The trouble starts here. -- jkern | |
while counter < 100: | |
# return x # you don't need this -- jkern | |
x, y = y, x + y # nice! (where did you find this?) -- jkern | |
# n = fib() # lol wut? This is cool, it's almost recursion ... -- jkern | |
# for x in range(100): # Here be dragons! -- jkern | |
print x | |
# I've left an error in here, somewhere ... remember Ctrl-C breaks. | |
# You were really, really close. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment