      "            length += 1\n",
      "            curr = curr.next\n",
      "        iterations_to_compare_half = length / 2\n",
      "        curr = self.head\n",
      "        curr_reversed = reversed_list.head\n",
      "        for _ in xrange(0, iterations_to_compare_half):\n",
      "            if curr.data != curr_reversed.data:\n",
      "                return False\n",
 
</s> remove     "print('Empty list')\n",
    "linked_list = MyLinkedList()\n",
    "print(linked_list.is_palindrome())\n",
    "print('Single element list')\n",
    "head = Node(1)\n",
    "linked_list = MyLinkedList(head)\n",
    "print(linked_list.is_palindrome())\n",
    "print('Two element list, not a palindrome')\n",
    "linked_list.append(2)\n",
    "print(linked_list.is_palindrome())\n",
    "print('Three element list, not a palindrome')\n",
    "linked_list.append(3)\n",
    "print(linked_list.is_palindrome())\n",
    "print('General case: Palindrome with even length')\n",
    "head = Node('a')\n",
    "linked_list = MyLinkedList(head)\n",
    "linked_list.append('b')\n",
    "linked_list.append('b')\n",
    "linked_list.append('a')\n",
    "print(linked_list.is_palindrome())\n",
    "print('General case: Palindrome with odd length')\n",
    "head = Node(1)\n",
    "linked_list = MyLinkedList(head)\n",
    "linked_list.append(2)\n",
    "linked_list.append(3)\n",
    "linked_list.append(2)\n",
    "linked_list.append(1)\n",
    "print(linked_list.is_palindrome())"
 </s> add     "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_is_palindrome(self):\n",
    "        print('Test: Empty list')\n",
    "        linked_list = MyLinkedList()\n",
    "        assert_equal(linked_list.is_palindrome(), False)\n",
    "\n",
    "        print('Test: Single element list')\n",
    "        head = Node(1)\n",
    "        linked_list = MyLinkedList(head)\n",
    "        assert_equal(linked_list.is_palindrome(), False)\n",
    "\n",
    "        print('Test: Two element list, not a palindrome')\n",
    "        linked_list.append(2)\n",
    "        assert_equal(linked_list.is_palindrome(), False)\n",
    "\n",
    "        print('Test: Three element list, not a palindrome')\n",
    "        linked_list.append(3)\n",
    "        assert_equal(linked_list.is_palindrome(), False)\n",
    "\n",
    "        print('Test: General case: Palindrome with even length')\n",
    "        head = Node('a')\n",
    "        linked_list = MyLinkedList(head)\n",
    "        linked_list.append('b')\n",
    "        linked_list.append('b')\n",
    "        linked_list.append('a')\n",
    "        assert_equal(linked_list.is_palindrome(), True)\n",
    "\n",
    "        print('Test: General case: Palindrome with odd length')\n",
    "        head = Node(1)\n",
    "        linked_list = MyLinkedList(head)\n",
    "        linked_list.append(2)\n",
    "        linked_list.append(3)\n",
    "        linked_list.append(2)\n",
    "        linked_list.append(1)\n",
    "        assert_equal(linked_list.is_palindrome(), True)\n",
    "        \n",
    "        print('Success: test_is_palindrome')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    test.test_is_palindrome()" </s> remove     "    * No"
 </s> add     "    * No\n",
    "* Can we assume we already have a linked list class that can be used for this problem?\n",
    "    * Yes" </s> remove     "## Clarifying Questions\n",
 </s> add     "## Constraints and Assumptions\n",
    "\n",
    "*Problem statements are often intentionally ambiguous.  Identifying constraints and stating assumptions can help to ensure you code the intended solution.*\n", </s> remove    "outputs": [],
 </s> add    "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Test: Empty list\n",
      "Test: Single element list\n",
      "Test: Two element list, not a palindrome\n",
      "Test: Three element list, not a palindrome\n",
      "Test: General case: Palindrome with even length\n",
      "Test: General case: Palindrome with odd length\n",
      "Success: test_is_palindrome\n"
     ]
    }
   ],
    "            \n",
    "        # Compare the reversed list with the original list\n",
    "        # Only need to compare the first half            \n",
      "            length += 1\n",
      "            curr = curr.next\n",
    "            \n",
    "        # Compare the reversed list with the original list\n",
    "        # Only need to compare the first half            \n",
      "        iterations_to_compare_half = length / 2\n",
      "        curr = self.head\n",
      "        curr_reversed = reversed_list.head\n",
      "        for _ in xrange(0, iterations_to_compare_half):\n",
      "            if curr.data != curr_reversed.data:\n",
      "                return False\n",
keep add keep keep keep keep keep keep
 Reworked notebook: Added more detail to constraints and test cases.  Reworked unit test. 
linked-lists/palindrome.ipynb