From: Neil Smith Date: Sat, 6 Oct 2018 19:21:57 +0000 (+0100) Subject: Tweaked python task 7 X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=857d929fb4bca42e231de9ad7fb2243bd27a2670;p=summerofcode2018soln.git Tweaked python task 7 --- diff --git a/src/task7/task7.ipynb b/src/task7/task7.ipynb index b760261..cecfa91 100644 --- a/src/task7/task7.ipynb +++ b/src/task7/task7.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 10, + "execution_count": 25, "metadata": {}, "outputs": [], "source": [ @@ -20,12 +20,12 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 26, "metadata": {}, "outputs": [], "source": [ "def burnt_sorted(pancakes):\n", - " return pancakes == sorted(pancakes)\n", + " return all(p > 0 for p in pancakes) and pancakes == sorted(pancakes)\n", "\n", "def unburnt_sorted(pancakes):\n", " simple_pancakes = [abs(p) for p in pancakes]\n", @@ -34,7 +34,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 27, "metadata": {}, "outputs": [], "source": [ @@ -43,7 +43,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 28, "metadata": {}, "outputs": [], "source": [ @@ -53,7 +53,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 29, "metadata": {}, "outputs": [ { @@ -62,7 +62,7 @@ "69" ] }, - "execution_count": 14, + "execution_count": 29, "metadata": {}, "output_type": "execute_result" } @@ -74,7 +74,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 30, "metadata": {}, "outputs": [ { @@ -83,7 +83,7 @@ "92" ] }, - "execution_count": 15, + "execution_count": 30, "metadata": {}, "output_type": "execute_result" }