diff --git a/arrays_strings/reverse_string/reverse_string_solution.ipynb b/arrays_strings/reverse_string/reverse_string_solution.ipynb index 8f69a2b..43f3376 100644 --- a/arrays_strings/reverse_string/reverse_string_solution.ipynb +++ b/arrays_strings/reverse_string/reverse_string_solution.ipynb @@ -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" ] }, {