From c633ecf1fe181cb17e18fec8fcfaa302e146e33e Mon Sep 17 00:00:00 2001 From: Victor Figueira Date: Tue, 23 Oct 2018 23:27:05 -0300 Subject: [PATCH] =?UTF-8?q?Modifica=C3=A7=C3=A3o=20na=20fun=C3=A7=C3=A3o?= =?UTF-8?q?=20review=20count?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit metodo srt .count() trata casos de 0 ocorrĂȘncias --- Lambda New Features.ipynb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Lambda New Features.ipynb b/Lambda New Features.ipynb index a5f8d59..96ce44d 100644 --- a/Lambda New Features.ipynb +++ b/Lambda New Features.ipynb @@ -58,17 +58,13 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 13, "metadata": {}, "outputs": [], "source": [ "def word_count(review, word):\n", - " cont = 0\n", " review = review.lower()\n", - " if word in review.lower():\n", - " return review.count(word)\n", - " else:\n", - " return 0" + " return review.count(word)" ] }, {