mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-06 17:38:02 +00:00
Changed xrange to range to be compatible with Python 3.
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user