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": [], "outputs": [],
"source": [ "source": [
"def list_of_chars(list_chars):\n", "def list_of_chars(chars):\n",
" if list_chars is None:\n", " if chars is None:\n",
" return None\n", " return None\n",
" string_length = len(list_chars)\n", " size = len(chars)\n",
" for i in xrange(string_length/2):\n", " for i in xrange(size/2):\n",
" list_chars[i], list_chars[string_length-1-i] = \\\n", " chars[i], chars[size-1-i] = \\\n",
" list_chars[string_length-1-i], list_chars[i]\n", " chars[size-1-i], chars[i]\n",
" return list_chars" " return chars"
] ]
}, },
{ {