Changed xrange to range to be compatible with Python 3.

This commit is contained in:
Donne Martin
2015-07-06 06:15:53 -04:00
parent fac7bbb1be
commit 45fa576bc2
21 changed files with 41 additions and 42 deletions

View File

@@ -117,7 +117,7 @@
"def fib_iterative(n):\n",
" a = 0 \n",
" b = 1\n",
" for _ in xrange(n):\n",
" for _ in range(n):\n",
" a, b = b, a + b\n",
" return a"
]
@@ -154,7 +154,7 @@
" \n",
" def test_fib(self, func):\n",
" result = []\n",
" for i in xrange(num_items):\n",
" for i in range(num_items):\n",
" result.append(func(i))\n",
" fib_seq = [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]\n",
" assert_equal(result, fib_seq)\n",