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

@@ -82,8 +82,8 @@
"source": [
"def max_xor(lower, upper):\n",
" result = 0\n",
" for l in xrange(lower, upper + 1):\n",
" for u in xrange(lower, upper + 1):\n",
" for l in range(lower, upper + 1):\n",
" for u in range(lower, upper + 1):\n",
" curr = l ^ u\n",
" if result < curr:\n",
" result = curr\n",

View File

@@ -87,7 +87,7 @@
" height = 1\n",
" if cycles == 0:\n",
" return height\n",
" for i in xrange(1, cycles+1):\n",
" for i in range(1, cycles+1):\n",
" if i % 2 == 1:\n",
" height *= 2\n",
" else:\n",