PY-1842 Extract method within while breaks content and generates endless loop

This commit is contained in:
Oleg Shpynov
2010-09-15 18:57:54 +04:00
parent cad6632730
commit 9cf765c24d
3 changed files with 38 additions and 0 deletions
@@ -0,0 +1,14 @@
def fib(n):
a, b = 0, 1
while b < n:
<begin>print(b, end=' ')
a, b = b, a+b<end>
print()
fib(7)
<result>
In:
a
b
Out:
a
b