X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;ds=sidebyside;f=src%2Ftask5%2Ftask5-nore.ipynb;fp=src%2Ftask5%2Ftask5-nore.ipynb;h=d40bec67e2a527a7eb6d4ec85a89273c75cf9ff5;hb=5fcd6565317ea77d297bf3c6a349754f9bbd94cf;hp=0d215fdea9aee21ee2df4ff1822cbe6be7942baa;hpb=6e2b9f4076f380e747db63e75ac8abaad3e6e2bf;p=summerofcode2018soln.git diff --git a/src/task5/task5-nore.ipynb b/src/task5/task5-nore.ipynb index 0d215fd..d40bec6 100644 --- a/src/task5/task5-nore.ipynb +++ b/src/task5/task5-nore.ipynb @@ -61,14 +61,14 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 15, "metadata": {}, "outputs": [], "source": [ "def expand_no_re(text, expansion_limit=None):\n", " i = 1\n", " s, e, l, n = find_expansion_mark(text)\n", - " while s and (expansion_limit is None or (expansion_limit is not None and i <= expansion_limit)):\n", + " while s is not None and (expansion_limit is None or (expansion_limit is not None and i <= expansion_limit)):\n", " text = text[:s-l] + text[s-l:s] * n + text[e+1:]\n", " s, e, l, n = find_expansion_mark(text)\n", " i += 1\n", @@ -77,7 +77,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 16, "metadata": {}, "outputs": [], "source": [ @@ -86,7 +86,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 17, "metadata": {}, "outputs": [], "source": [ @@ -96,7 +96,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 18, "metadata": {}, "outputs": [ { @@ -105,7 +105,7 @@ "149043" ] }, - "execution_count": 8, + "execution_count": 18, "metadata": {}, "output_type": "execute_result" } @@ -116,7 +116,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 19, "metadata": {}, "outputs": [ { @@ -125,7 +125,7 @@ "302266" ] }, - "execution_count": 9, + "execution_count": 19, "metadata": {}, "output_type": "execute_result" }