Travis build: 136

This commit is contained in:
30secondsofcode
2019-10-04 06:15:42 +00:00
parent 8adfbefaff
commit e5d48daa30
3 changed files with 63 additions and 0 deletions

View File

@ -774,6 +774,21 @@
"hash": "a87775ce6bd1590c7c7b31b7dfce03b00120e4e8183c65cec8fdd3841fa369d7"
}
},
{
"id": "median",
"type": "snippetListing",
"title": "median",
"attributes": {
"text": "Finds the median of a list of numbers.\n\nSort the numbers of the list using `list.sort()` and find the median, which is either the middle element of the list if the list length is odd or the average of the two middle elements if the list length is even.\n\n",
"tags": [
"math",
"beginner"
]
},
"meta": {
"hash": "a2f09e1423bde7161422814e3ecdb2ce77dac812df719ea60c37f55c06a06705"
}
},
{
"id": "min_by",
"type": "snippetListing",

View File

@ -1024,6 +1024,26 @@
"hash": "a87775ce6bd1590c7c7b31b7dfce03b00120e4e8183c65cec8fdd3841fa369d7"
}
},
{
"id": "median",
"title": "median",
"type": "snippet",
"attributes": {
"fileName": "median.md",
"text": "Finds the median of a list of numbers.\n\nSort the numbers of the list using `list.sort()` and find the median, which is either the middle element of the list if the list length is odd or the average of the two middle elements if the list length is even.\n\n",
"codeBlocks": {
"code": "def median(list):\n list.sort()\n list_length = len(list)\n if list_length%2==0:\n return (list[int(list_length/2)-1] + list[int(list_length/2)])/2\n else:\n return list[int(list_length/2)]",
"example": "median([1,2,3]) # 2\nmedian([1,2,3,4]) # 2.5"
},
"tags": [
"math",
"beginner"
]
},
"meta": {
"hash": "a2f09e1423bde7161422814e3ecdb2ce77dac812df719ea60c37f55c06a06705"
}
},
{
"id": "min_by",
"title": "min_by",