Tweaked reverse challenge code solution.

This commit is contained in:
Donne Martin 2015-07-05 09:10:22 -04:00
parent 11bd2e9768
commit a1990f2298

View File

@ -93,14 +93,14 @@
},
"outputs": [],
"source": [
"def list_of_chars(list_chars):\n",
" if list_chars is None:\n",
"def list_of_chars(chars):\n",
" if chars is None:\n",
" return None\n",
" string_length = len(list_chars)\n",
" for i in xrange(string_length/2):\n",
" list_chars[i], list_chars[string_length-1-i] = \\\n",
" list_chars[string_length-1-i], list_chars[i]\n",
" return list_chars"
" size = len(chars)\n",
" for i in xrange(size/2):\n",
" chars[i], chars[size-1-i] = \\\n",
" chars[size-1-i], chars[i]\n",
" return chars"
]
},
{