Skip to content

Instantly share code, notes, and snippets.

@jameskyle
Last active August 29, 2015 14:00
Show Gist options
  • Select an option

  • Save jameskyle/11105100 to your computer and use it in GitHub Desktop.

Select an option

Save jameskyle/11105100 to your computer and use it in GitHub Desktop.
# correct
def func1(num):
x, y = (1, 0)
h = 0.1
for n in xrange(num):
x_n = x
y_n = y
x = x_n + h
y = y_n + h * (x_n - y_n**2)
yield (x,y)
# incorrect
def func2(num):
x, y = (1, 0)
h = 0.1
for n in xrange(num):
x = x + h
y = y + h * (x - y**2)
yield (x,y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment