Travis build: 310

This commit is contained in:
30secondsofcode
2020-01-05 12:40:49 +00:00
parent f28ac824d4
commit ccb01a5ad7
2 changed files with 16 additions and 16 deletions

View File

@ -482,14 +482,14 @@
"type": "snippetListing", "type": "snippetListing",
"title": "filter_non_unique", "title": "filter_non_unique",
"attributes": { "attributes": {
"text": "Filters out the non-unique values in a list.\n\nUse list comprehension and `list.count()` to create a list containing only the unique values.\n\n", "text": "Filters out the non-unique values in a list.\n\nUse a `Counter` to get the count of each value in the list.\nUse list comprehension to create a list containing only the unique values.\n\n",
"tags": [ "tags": [
"list", "list",
"beginner" "beginner"
] ]
}, },
"meta": { "meta": {
"hash": "05679ae115d276830ec769a04b0800d92eabc6a09678fc1a9cf6013c813cc650" "hash": "cc048906b1a368428244af8202aeb3a60b1b7b7bf52ad744e92d3e21f6be95f2"
} }
}, },
{ {
@ -497,14 +497,14 @@
"type": "snippetListing", "type": "snippetListing",
"title": "filter_unique", "title": "filter_unique",
"attributes": { "attributes": {
"text": "Filters out the unique values in a list.\n\nUse list comprehension and `list.count()` to create a list containing only the non-unique values.\n\n", "text": "Filters out the unique values in a list.\n\nUse a `Counter` to get the count of each value in the list.\nUse list comprehension to create a list containing only the non-unique values.\n\n",
"tags": [ "tags": [
"list", "list",
"beginner" "beginner"
] ]
}, },
"meta": { "meta": {
"hash": "174c62134c81e139aa9d0b31f46c684b5edd4c52e721136d586d435058e19288" "hash": "f3e5cada914ae863ca9cf8fd8780b1634ea526d78f1f542c5c7577f6dd685cfc"
} }
}, },
{ {

View File

@ -762,9 +762,9 @@
"type": "snippet", "type": "snippet",
"attributes": { "attributes": {
"fileName": "filter_non_unique.md", "fileName": "filter_non_unique.md",
"text": "Filters out the non-unique values in a list.\n\nUse list comprehension and `list.count()` to create a list containing only the unique values.\n\n", "text": "Filters out the non-unique values in a list.\n\nUse a `Counter` to get the count of each value in the list.\nUse list comprehension to create a list containing only the unique values.\n\n",
"codeBlocks": { "codeBlocks": {
"code": "def filter_non_unique(lst):\n return [item for item in lst if lst.count(item) == 1]", "code": "from collections import Counter\n\ndef filter_non_unique(lst):\n return [item for item, count in counter = Counter(lst).items() if count == 1]",
"example": "filter_non_unique([1, 2, 2, 3, 4, 4, 5]) # [1, 3, 5]" "example": "filter_non_unique([1, 2, 2, 3, 4, 4, 5]) # [1, 3, 5]"
}, },
"tags": [ "tags": [
@ -773,11 +773,11 @@
] ]
}, },
"meta": { "meta": {
"hash": "05679ae115d276830ec769a04b0800d92eabc6a09678fc1a9cf6013c813cc650", "hash": "cc048906b1a368428244af8202aeb3a60b1b7b7bf52ad744e92d3e21f6be95f2",
"firstSeen": "1566296031", "firstSeen": "1566296031",
"lastUpdated": "1566296031", "lastUpdated": "1578227946",
"updateCount": 2, "updateCount": 4,
"authorCount": 2 "authorCount": 3
} }
}, },
{ {
@ -786,9 +786,9 @@
"type": "snippet", "type": "snippet",
"attributes": { "attributes": {
"fileName": "filter_unique.md", "fileName": "filter_unique.md",
"text": "Filters out the unique values in a list.\n\nUse list comprehension and `list.count()` to create a list containing only the non-unique values.\n\n", "text": "Filters out the unique values in a list.\n\nUse a `Counter` to get the count of each value in the list.\nUse list comprehension to create a list containing only the non-unique values.\n\n",
"codeBlocks": { "codeBlocks": {
"code": "def filter_unique(lst):\n return [x for x in set(item for item in lst if lst.count(item) > 1)]", "code": "from collections import Counter\n\ndef filter_unique(lst):\n return [item for item, count in Counter(lst).items() if count > 1]",
"example": "filter_unique([1, 2, 2, 3, 4, 4, 5]) # [2, 4]" "example": "filter_unique([1, 2, 2, 3, 4, 4, 5]) # [2, 4]"
}, },
"tags": [ "tags": [
@ -797,11 +797,11 @@
] ]
}, },
"meta": { "meta": {
"hash": "174c62134c81e139aa9d0b31f46c684b5edd4c52e721136d586d435058e19288", "hash": "f3e5cada914ae863ca9cf8fd8780b1634ea526d78f1f542c5c7577f6dd685cfc",
"firstSeen": "1570035984", "firstSeen": "1570035984",
"lastUpdated": "1570516752", "lastUpdated": "1578227961",
"updateCount": 4, "updateCount": 7,
"authorCount": 3 "authorCount": 4
} }
}, },
{ {