      "            pos += 2\n",
      "            count = 1\n",
      "            last_char_code = char_code\n",
      "    compressed_string[pos] = last_char_code\n",
      "    compressed_string[pos + 1] = ord(str(count))\n",
      "    return compressed_string\n",
      "\n",
      "run_tests(compress_string_alt)"
     ]
    }
   ],
 
</s> remove     "            compressed_string[pos + 1] = ord(str(count))\n",
 </s> add     "            compressed_string[pos+1] = ord(str(count))\n", </s> remove     "run_tests(compress_string_alt)"
 </s> add     "class Test(object):\n",
    "    def test_compress(self, func):\n",
    "        assert_equal(func(None), None)\n",
    "        assert_equal(func(''), '')\n",
    "        assert_equal(func('ABC'), 'ABC')\n",
    "        assert_equal(func('AAABCCDDDD'), 'A3B1C2D4')\n",
    "        print('Success: test_compress')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    test.test_compress(compress_string)\n",
    "    test.test_compress(compress_string_alt)" </s> remove     "            count = 1\n",
 </s> add 
    "    compressed_string[pos+1] = ord(str(count))\n",
    "    return compressed_string"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Unit Test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Success: test_compress\n",
      "Success: test_compress\n"
     ]
    }
   ],
   "source": [
    "from nose.tools import assert_equal\n",
      "            pos += 2\n",
      "            count = 1\n",
      "            last_char_code = char_code\n",
      "    compressed_string[pos] = last_char_code\n",
    "    compressed_string[pos+1] = ord(str(count))\n",
    "    return compressed_string"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Unit Test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Success: test_compress\n",
      "Success: test_compress\n"
     ]
    }
   ],
   "source": [
    "from nose.tools import assert_equal\n",
    "    compressed_string[pos+1] = ord(str(count))\n",
    "    return compressed_string"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Unit Test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Success: test_compress\n",
      "Success: test_compress\n"
     ]
    }
   ],
   "source": [
    "from nose.tools import assert_equal\n",
      "\n",
      "run_tests(compress_string_alt)"
     ]
    }
   ],
keep keep keep keep replace replace keep keep keep keep keep
 Reworked notebook: Added more detail to clarifying questions and test cases.  Reworked algorithm discussion, code, and unit test. 
arrays-strings/compress.ipynb