From c8341dabdbe740f49dc5a4e58b40534cadd3d192 Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Wed, 18 Sep 2019 06:07:06 +0000 Subject: [PATCH] Travis build: 82 --- README.md | 4 ++-- snippet_data/snippetList.json | 4 ++-- snippet_data/snippets.json | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b5c5bfab1..57a5e3163 100644 --- a/README.md +++ b/README.md @@ -444,11 +444,11 @@ every([1, 2, 3]) # True Returns every nth element in a list. -Use `[1::nth]` to create a new list that contains every nth element of the given list. +Use `[nth-1::nth]` to create a new list that contains every nth element of the given list. ```py def every_nth(lst, nth): - return lst[1::nth] + return lst[nth-1::nth] ```
diff --git a/snippet_data/snippetList.json b/snippet_data/snippetList.json index 49029fbec..c261d1027 100644 --- a/snippet_data/snippetList.json +++ b/snippet_data/snippetList.json @@ -345,14 +345,14 @@ "type": "snippetListing", "title": "every_nth", "attributes": { - "text": "Returns every nth element in a list.\n\nUse `[1::nth]` to create a new list that contains every nth element of the given list.\n\n", + "text": "Returns every nth element in a list.\n\nUse `[nth-1::nth]` to create a new list that contains every nth element of the given list.\n\n", "tags": [ "list", "beginner" ] }, "meta": { - "hash": "d5c51547b66fcd9d42def2a6d92ba98429a12c6bec56a0dca8e4c0289525d5de" + "hash": "038e0fd0752bbd88c73ea9059e10768bbf31fd3178113738064405e010aa8aa7" } }, { diff --git a/snippet_data/snippets.json b/snippet_data/snippets.json index 0330c5390..8e9990536 100644 --- a/snippet_data/snippets.json +++ b/snippet_data/snippets.json @@ -456,9 +456,9 @@ "type": "snippet", "attributes": { "fileName": "every_nth.md", - "text": "Returns every nth element in a list.\n\nUse `[1::nth]` to create a new list that contains every nth element of the given list.\n\n", + "text": "Returns every nth element in a list.\n\nUse `[nth-1::nth]` to create a new list that contains every nth element of the given list.\n\n", "codeBlocks": { - "code": "def every_nth(lst, nth):\n return lst[1::nth]", + "code": "def every_nth(lst, nth):\n return lst[nth-1::nth]", "example": "every_nth([1, 2, 3, 4, 5, 6], 2) # [ 2, 4, 6 ]" }, "tags": [ @@ -467,7 +467,7 @@ ] }, "meta": { - "hash": "d5c51547b66fcd9d42def2a6d92ba98429a12c6bec56a0dca8e4c0289525d5de" + "hash": "038e0fd0752bbd88c73ea9059e10768bbf31fd3178113738064405e010aa8aa7" } }, {