Travis build: 82
This commit is contained in:
@ -444,11 +444,11 @@ every([1, 2, 3]) # True
|
|||||||
|
|
||||||
Returns every nth element in a list.
|
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
|
```py
|
||||||
def every_nth(lst, nth):
|
def every_nth(lst, nth):
|
||||||
return lst[1::nth]
|
return lst[nth-1::nth]
|
||||||
```
|
```
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
|
|||||||
@ -345,14 +345,14 @@
|
|||||||
"type": "snippetListing",
|
"type": "snippetListing",
|
||||||
"title": "every_nth",
|
"title": "every_nth",
|
||||||
"attributes": {
|
"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": [
|
"tags": [
|
||||||
"list",
|
"list",
|
||||||
"beginner"
|
"beginner"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"meta": {
|
"meta": {
|
||||||
"hash": "d5c51547b66fcd9d42def2a6d92ba98429a12c6bec56a0dca8e4c0289525d5de"
|
"hash": "038e0fd0752bbd88c73ea9059e10768bbf31fd3178113738064405e010aa8aa7"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -456,9 +456,9 @@
|
|||||||
"type": "snippet",
|
"type": "snippet",
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"fileName": "every_nth.md",
|
"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": {
|
"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 ]"
|
"example": "every_nth([1, 2, 3, 4, 5, 6], 2) # [ 2, 4, 6 ]"
|
||||||
},
|
},
|
||||||
"tags": [
|
"tags": [
|
||||||
@ -467,7 +467,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"meta": {
|
"meta": {
|
||||||
"hash": "d5c51547b66fcd9d42def2a6d92ba98429a12c6bec56a0dca8e4c0289525d5de"
|
"hash": "038e0fd0752bbd88c73ea9059e10768bbf31fd3178113738064405e010aa8aa7"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user