      "collapsed": false
     },
     "outputs": [],
     "source": [
      "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())"
     ]
    }
   ],
   "metadata": {
    "kernelspec": {
 
</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"
     ]
    }
   ], </s> remove    "execution_count": null,
 </s> add    "execution_count": 3,
    "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()"
      "collapsed": false
     },
     "outputs": [],
     "source": [
    "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()"
    "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()"
    "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()"
    "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()"
    "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()"
    "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()"
    "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()"
    "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()"
    "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()"
    "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()"
    "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()"
    "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()"
    "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()"
    "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()"
    "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()"
    "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()"
    "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()"
    "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()"
    "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()"
    "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()"
    "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()"
    "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()"
    "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()"
    "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()"
    "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()"
    "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()"
    "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()"
    "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()"
     ]
    }
   ],
   "metadata": {
    "kernelspec": {
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Reworked notebook: Added more detail to constraints and test cases.  Reworked unit test. 
linked-lists/palindrome.ipynb