yield and ASSERTION ERROR #7

myroslav opened this Issue Mar 9, 2012 · 0 comments


None yet
2 participants

myroslav commented Mar 9, 2012

When stepping through this program, on second iteration of for loop when entering iterator Tutor starts displaying ASSERTIOn ERRORs, but continues to work properly:

def fibonacci():
   a, b = 1, 2
   while True:
      yield a
      a, b = b, a+b

f = fibonacci()
for i in range(10):
    print f.next()

@pgbovine pgbovine closed this Sep 19, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment