From 03d6954103f37d9ebfb03e4ab116b06413f93040 Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Wed, 18 Sep 2019 20:48:31 +0000 Subject: [PATCH] Travis build: 87 --- README.md | 2 +- snippet_data/snippetList.json | 2 +- snippet_data/snippets.json | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3ba2a2544..97ae4852c 100644 --- a/README.md +++ b/README.md @@ -503,7 +503,7 @@ def group_by(lst, fn): ```py import math group_by([6.1, 4.2, 6.3], math.floor); # {4: [4.2], 6: [6.1, 6.3]} -group_by(['one', 'two', 'three'], 'length'); # {3: ['one', 'two'], 5: ['three']} +group_by(['one', 'two', 'three'], len); # {3: ['one', 'two'], 5: ['three']} ``` diff --git a/snippet_data/snippetList.json b/snippet_data/snippetList.json index 573c052cc..8f250e9c0 100644 --- a/snippet_data/snippetList.json +++ b/snippet_data/snippetList.json @@ -430,7 +430,7 @@ ] }, "meta": { - "hash": "e103229c295cbfcbf26b5529b068e382bb0a1a04e080311e46302721841bbfe0" + "hash": "8e552ea1be04303164bd9c480ebd7392bcc79ef620ce18ee6436dc1dc41c1e42" } }, { diff --git a/snippet_data/snippets.json b/snippet_data/snippets.json index 1992a051e..a64d4144e 100644 --- a/snippet_data/snippets.json +++ b/snippet_data/snippets.json @@ -561,7 +561,7 @@ "text": "Groups the elements of a list based on the given function.\n\nUse `list()` in combination with `map()` and `fn` to map the values of the list to the keys of an object.\nUse list comprehension to map each element to the appropriate `key`.\n\n", "codeBlocks": { "code": "def group_by(lst, fn):\n groups = {}\n for key in list(map(fn,lst)):\n groups[key] = [item for item in lst if fn(item) == key]\n return groups", - "example": "import math\ngroup_by([6.1, 4.2, 6.3], math.floor); # {4: [4.2], 6: [6.1, 6.3]}\ngroup_by(['one', 'two', 'three'], 'length'); # {3: ['one', 'two'], 5: ['three']}" + "example": "import math\ngroup_by([6.1, 4.2, 6.3], math.floor); # {4: [4.2], 6: [6.1, 6.3]}\ngroup_by(['one', 'two', 'three'], len); # {3: ['one', 'two'], 5: ['three']}" }, "tags": [ "list", @@ -570,7 +570,7 @@ ] }, "meta": { - "hash": "e103229c295cbfcbf26b5529b068e382bb0a1a04e080311e46302721841bbfe0" + "hash": "8e552ea1be04303164bd9c480ebd7392bcc79ef620ce18ee6436dc1dc41c1e42" } }, {