[{"data":1,"prerenderedAt":2156},["ShallowReactive",2],{"doc-\u002Freference\u002Fpython-min-function-explained":3},{"id":4,"title":5,"body":6,"description":2149,"extension":2150,"meta":2151,"navigation":112,"path":2152,"seo":2153,"stem":2154,"__hash__":2155},"content\u002Freference\u002Fpython-min-function-explained.md","Python min() Function Explained",{"type":7,"value":8,"toc":2106},"minimark",[9,19,25,31,36,141,144,158,164,171,189,193,199,282,289,292,338,340,348,354,357,388,390,398,404,410,479,481,490,493,508,514,520,557,559,568,575,582,587,636,638,647,650,694,696,705,708,720,726,731,784,786,795,798,850,852,861,864,874,880,886,889,904,908,970,972,981,985,1174,1176,1216,1223,1229,1232,1259,1261,1287,1292,1329,1331,1340,1343,1346,1362,1369,1373,1378,1384,1389,1418,1421,1431,1471,1475,1478,1526,1528,1537,1540,1545,1622,1624,1633,1639,1643,1646,1699,1701,1709,1712,1778,1780,1788,1791,1797,1802,1815,1822,1831,1835,1838,1870,1876,1978,1988,1992,1999,2002,2009,2012,2016,2027,2036,2045,2054,2062,2066,2102],[10,11,13,14,18],"h1",{"id":12},"python-min-function-explained","Python ",[15,16,17],"code",{},"min()"," Function Explained",[20,21,22,24],"p",{},[15,23,17],{}," is a built-in Python function that returns the smallest item. You can use it with a single iterable, like a list or tuple, or with multiple values separated by commas.",[20,26,27,28,30],{},"This page explains what ",[15,29,17],{}," does, its main syntax forms, and the common mistakes beginners make when using it.",[32,33,35],"h2",{"id":34},"quick-example","Quick example",[37,38,43],"pre",{"className":39,"code":40,"language":41,"meta":42,"style":42},"language-python shiki shiki-themes material-theme-lighter github-light github-dark","numbers = [5, 2, 9, 1]\nprint(min(numbers))\n\nprint(min(5, 2, 9, 1))\n","python","",[15,44,45,85,107,114],{"__ignoreMap":42},[46,47,50,54,58,62,66,69,72,74,77,79,82],"span",{"class":48,"line":49},"line",1,[46,51,53],{"class":52},"su5hD","numbers ",[46,55,57],{"class":56},"smGrS","=",[46,59,61],{"class":60},"sP7_E"," [",[46,63,65],{"class":64},"srdBf","5",[46,67,68],{"class":60},",",[46,70,71],{"class":64}," 2",[46,73,68],{"class":60},[46,75,76],{"class":64}," 9",[46,78,68],{"class":60},[46,80,81],{"class":64}," 1",[46,83,84],{"class":60},"]\n",[46,86,88,92,95,98,100,104],{"class":48,"line":87},2,[46,89,91],{"class":90},"sptTA","print",[46,93,94],{"class":60},"(",[46,96,97],{"class":90},"min",[46,99,94],{"class":60},[46,101,103],{"class":102},"slqww","numbers",[46,105,106],{"class":60},"))\n",[46,108,110],{"class":48,"line":109},3,[46,111,113],{"emptyLinePlaceholder":112},true,"\n",[46,115,117,119,121,123,125,127,129,131,133,135,137,139],{"class":48,"line":116},4,[46,118,91],{"class":90},[46,120,94],{"class":60},[46,122,97],{"class":90},[46,124,94],{"class":60},[46,126,65],{"class":64},[46,128,68],{"class":60},[46,130,71],{"class":64},[46,132,68],{"class":60},[46,134,76],{"class":64},[46,136,68],{"class":60},[46,138,81],{"class":64},[46,140,106],{"class":60},[20,142,143],{},"Output:",[37,145,147],{"className":39,"code":146,"language":41,"meta":42,"style":42},"1\n1\n",[15,148,149,154],{"__ignoreMap":42},[46,150,151],{"class":48,"line":49},[46,152,153],{"class":64},"1\n",[46,155,156],{"class":48,"line":87},[46,157,153],{"class":64},[20,159,160,161,163],{},"Use ",[15,162,17],{}," with one iterable like a list, or with multiple values separated by commas.",[32,165,167,168,170],{"id":166},"what-min-does","What ",[15,169,17],{}," does",[172,173,174,180,183,186],"ul",{},[175,176,177,179],"li",{},[15,178,17],{}," returns the smallest item",[175,181,182],{},"It can compare numbers, strings, and other comparable values",[175,184,185],{},"It is a built-in Python function",[175,187,188],{},"This page explains the function itself, not task-based use cases",[32,190,192],{"id":191},"main-syntax-forms","Main syntax forms",[20,194,195,196,198],{},"Here are the main ways to use ",[15,197,17],{},":",[37,200,202],{"className":39,"code":201,"language":41,"meta":42,"style":42},"min(iterable)\nmin(value1, value2, value3, ...)\nmin(iterable, key=...)\nmin(iterable, default=...)\n",[15,203,204,216,242,263],{"__ignoreMap":42},[46,205,206,208,210,213],{"class":48,"line":49},[46,207,97],{"class":90},[46,209,94],{"class":60},[46,211,212],{"class":102},"iterable",[46,214,215],{"class":60},")\n",[46,217,218,220,222,225,227,230,232,235,237,240],{"class":48,"line":87},[46,219,97],{"class":90},[46,221,94],{"class":60},[46,223,224],{"class":102},"value1",[46,226,68],{"class":60},[46,228,229],{"class":102}," value2",[46,231,68],{"class":60},[46,233,234],{"class":102}," value3",[46,236,68],{"class":60},[46,238,239],{"class":90}," ...",[46,241,215],{"class":60},[46,243,244,246,248,250,252,256,258,261],{"class":48,"line":109},[46,245,97],{"class":90},[46,247,94],{"class":60},[46,249,212],{"class":102},[46,251,68],{"class":60},[46,253,255],{"class":254},"s99_P"," key",[46,257,57],{"class":56},[46,259,260],{"class":90},"...",[46,262,215],{"class":60},[46,264,265,267,269,271,273,276,278,280],{"class":48,"line":116},[46,266,97],{"class":90},[46,268,94],{"class":60},[46,270,212],{"class":102},[46,272,68],{"class":60},[46,274,275],{"class":254}," default",[46,277,57],{"class":56},[46,279,260],{"class":90},[46,281,215],{"class":60},[283,284,286],"h3",{"id":285},"miniterable",[15,287,288],{},"min(iterable)",[20,290,291],{},"Use this form when you have one collection of values.",[37,293,295],{"className":39,"code":294,"language":41,"meta":42,"style":42},"numbers = [8, 3, 12, 1]\nprint(min(numbers))\n",[15,296,297,324],{"__ignoreMap":42},[46,298,299,301,303,305,308,310,313,315,318,320,322],{"class":48,"line":49},[46,300,53],{"class":52},[46,302,57],{"class":56},[46,304,61],{"class":60},[46,306,307],{"class":64},"8",[46,309,68],{"class":60},[46,311,312],{"class":64}," 3",[46,314,68],{"class":60},[46,316,317],{"class":64}," 12",[46,319,68],{"class":60},[46,321,81],{"class":64},[46,323,84],{"class":60},[46,325,326,328,330,332,334,336],{"class":48,"line":87},[46,327,91],{"class":90},[46,329,94],{"class":60},[46,331,97],{"class":90},[46,333,94],{"class":60},[46,335,103],{"class":102},[46,337,106],{"class":60},[20,339,143],{},[37,341,342],{"className":39,"code":153,"language":41,"meta":42,"style":42},[15,343,344],{"__ignoreMap":42},[46,345,346],{"class":48,"line":49},[46,347,153],{"class":64},[283,349,351],{"id":350},"minvalue1-value2-value3",[15,352,353],{},"min(value1, value2, value3, ...)",[20,355,356],{},"Use this form when you want to compare separate values directly.",[37,358,360],{"className":39,"code":359,"language":41,"meta":42,"style":42},"print(min(8, 3, 12, 1))\n",[15,361,362],{"__ignoreMap":42},[46,363,364,366,368,370,372,374,376,378,380,382,384,386],{"class":48,"line":49},[46,365,91],{"class":90},[46,367,94],{"class":60},[46,369,97],{"class":90},[46,371,94],{"class":60},[46,373,307],{"class":64},[46,375,68],{"class":60},[46,377,312],{"class":64},[46,379,68],{"class":60},[46,381,317],{"class":64},[46,383,68],{"class":60},[46,385,81],{"class":64},[46,387,106],{"class":60},[20,389,143],{},[37,391,392],{"className":39,"code":153,"language":41,"meta":42,"style":42},[15,393,394],{"__ignoreMap":42},[46,395,396],{"class":48,"line":49},[46,397,153],{"class":64},[283,399,401],{"id":400},"miniterable-key",[15,402,403],{},"min(iterable, key=...)",[20,405,160,406,409],{},[15,407,408],{},"key"," when you want Python to compare items using a custom rule.",[37,411,413],{"className":39,"code":412,"language":41,"meta":42,"style":42},"words = [\"pear\", \"kiwi\", \"banana\"]\nprint(min(words, key=len))\n",[15,414,415,455],{"__ignoreMap":42},[46,416,417,420,422,424,428,432,434,436,439,442,444,446,448,451,453],{"class":48,"line":49},[46,418,419],{"class":52},"words ",[46,421,57],{"class":56},[46,423,61],{"class":60},[46,425,427],{"class":426},"sjJ54","\"",[46,429,431],{"class":430},"s_sjI","pear",[46,433,427],{"class":426},[46,435,68],{"class":60},[46,437,438],{"class":426}," \"",[46,440,441],{"class":430},"kiwi",[46,443,427],{"class":426},[46,445,68],{"class":60},[46,447,438],{"class":426},[46,449,450],{"class":430},"banana",[46,452,427],{"class":426},[46,454,84],{"class":60},[46,456,457,459,461,463,465,468,470,472,474,477],{"class":48,"line":87},[46,458,91],{"class":90},[46,460,94],{"class":60},[46,462,97],{"class":90},[46,464,94],{"class":60},[46,466,467],{"class":102},"words",[46,469,68],{"class":60},[46,471,255],{"class":254},[46,473,57],{"class":56},[46,475,476],{"class":90},"len",[46,478,106],{"class":60},[20,480,143],{},[37,482,484],{"className":39,"code":483,"language":41,"meta":42,"style":42},"kiwi\n",[15,485,486],{"__ignoreMap":42},[46,487,488],{"class":48,"line":49},[46,489,483],{"class":52},[20,491,492],{},"Python compares the lengths of the strings, but it returns the original item, not the length.",[20,494,495,496,499,500,507],{},"If you are not familiar with ",[15,497,498],{},"len()",", see the ",[501,502,504,506],"a",{"href":503},"\u002Freference\u002Fpython-len-function-explained\u002F",[15,505,498],{}," function explained",".",[283,509,511],{"id":510},"miniterable-default",[15,512,513],{},"min(iterable, default=...)",[20,515,160,516,519],{},[15,517,518],{},"default"," when the iterable might be empty.",[37,521,523],{"className":39,"code":522,"language":41,"meta":42,"style":42},"numbers = []\nprint(min(numbers, default=0))\n",[15,524,525,534],{"__ignoreMap":42},[46,526,527,529,531],{"class":48,"line":49},[46,528,53],{"class":52},[46,530,57],{"class":56},[46,532,533],{"class":60}," []\n",[46,535,536,538,540,542,544,546,548,550,552,555],{"class":48,"line":87},[46,537,91],{"class":90},[46,539,94],{"class":60},[46,541,97],{"class":90},[46,543,94],{"class":60},[46,545,103],{"class":102},[46,547,68],{"class":60},[46,549,275],{"class":254},[46,551,57],{"class":56},[46,553,554],{"class":64},"0",[46,556,106],{"class":60},[20,558,143],{},[37,560,562],{"className":39,"code":561,"language":41,"meta":42,"style":42},"0\n",[15,563,564],{"__ignoreMap":42},[46,565,566],{"class":48,"line":49},[46,567,561],{"class":64},[20,569,570,571,574],{},"This avoids a ",[15,572,573],{},"ValueError"," when there is no item to return.",[32,576,578,579,581],{"id":577},"using-min-with-numbers","Using ",[15,580,17],{}," with numbers",[20,583,584,586],{},[15,585,17],{}," works with integers and floats. It returns the lowest numeric value.",[37,588,590],{"className":39,"code":589,"language":41,"meta":42,"style":42},"scores = [88, 72, 95, 60]\nprint(min(scores))\n",[15,591,592,621],{"__ignoreMap":42},[46,593,594,597,599,601,604,606,609,611,614,616,619],{"class":48,"line":49},[46,595,596],{"class":52},"scores ",[46,598,57],{"class":56},[46,600,61],{"class":60},[46,602,603],{"class":64},"88",[46,605,68],{"class":60},[46,607,608],{"class":64}," 72",[46,610,68],{"class":60},[46,612,613],{"class":64}," 95",[46,615,68],{"class":60},[46,617,618],{"class":64}," 60",[46,620,84],{"class":60},[46,622,623,625,627,629,631,634],{"class":48,"line":87},[46,624,91],{"class":90},[46,626,94],{"class":60},[46,628,97],{"class":90},[46,630,94],{"class":60},[46,632,633],{"class":102},"scores",[46,635,106],{"class":60},[20,637,143],{},[37,639,641],{"className":39,"code":640,"language":41,"meta":42,"style":42},"60\n",[15,642,643],{"__ignoreMap":42},[46,644,645],{"class":48,"line":49},[46,646,640],{"class":64},[20,648,649],{},"It also works with decimal values:",[37,651,653],{"className":39,"code":652,"language":41,"meta":42,"style":42},"prices = [19.99, 5.49, 12.75]\nprint(min(prices))\n",[15,654,655,679],{"__ignoreMap":42},[46,656,657,660,662,664,667,669,672,674,677],{"class":48,"line":49},[46,658,659],{"class":52},"prices ",[46,661,57],{"class":56},[46,663,61],{"class":60},[46,665,666],{"class":64},"19.99",[46,668,68],{"class":60},[46,670,671],{"class":64}," 5.49",[46,673,68],{"class":60},[46,675,676],{"class":64}," 12.75",[46,678,84],{"class":60},[46,680,681,683,685,687,689,692],{"class":48,"line":87},[46,682,91],{"class":90},[46,684,94],{"class":60},[46,686,97],{"class":90},[46,688,94],{"class":60},[46,690,691],{"class":102},"prices",[46,693,106],{"class":60},[20,695,143],{},[37,697,699],{"className":39,"code":698,"language":41,"meta":42,"style":42},"5.49\n",[15,700,701],{"__ignoreMap":42},[46,702,703],{"class":48,"line":49},[46,704,698],{"class":64},[20,706,707],{},"This is useful for things like:",[172,709,710,712,714,717],{},[175,711,633],{},[175,713,691],{},[175,715,716],{},"measurements",[175,718,719],{},"ages",[32,721,578,723,725],{"id":722},"using-min-with-strings",[15,724,17],{}," with strings",[20,727,728,730],{},[15,729,17],{}," can also compare strings. It uses character order, which is similar to alphabetical order.",[37,732,734],{"className":39,"code":733,"language":41,"meta":42,"style":42},"words = [\"banana\", \"apple\", \"cherry\"]\nprint(min(words))\n",[15,735,736,770],{"__ignoreMap":42},[46,737,738,740,742,744,746,748,750,752,754,757,759,761,763,766,768],{"class":48,"line":49},[46,739,419],{"class":52},[46,741,57],{"class":56},[46,743,61],{"class":60},[46,745,427],{"class":426},[46,747,450],{"class":430},[46,749,427],{"class":426},[46,751,68],{"class":60},[46,753,438],{"class":426},[46,755,756],{"class":430},"apple",[46,758,427],{"class":426},[46,760,68],{"class":60},[46,762,438],{"class":426},[46,764,765],{"class":430},"cherry",[46,767,427],{"class":426},[46,769,84],{"class":60},[46,771,772,774,776,778,780,782],{"class":48,"line":87},[46,773,91],{"class":90},[46,775,94],{"class":60},[46,777,97],{"class":90},[46,779,94],{"class":60},[46,781,467],{"class":102},[46,783,106],{"class":60},[20,785,143],{},[37,787,789],{"className":39,"code":788,"language":41,"meta":42,"style":42},"apple\n",[15,790,791],{"__ignoreMap":42},[46,792,793],{"class":48,"line":49},[46,794,788],{"class":52},[20,796,797],{},"Be careful with uppercase and lowercase letters. They are not treated the same.",[37,799,801],{"className":39,"code":800,"language":41,"meta":42,"style":42},"words = [\"banana\", \"Apple\", \"cherry\"]\nprint(min(words))\n",[15,802,803,836],{"__ignoreMap":42},[46,804,805,807,809,811,813,815,817,819,821,824,826,828,830,832,834],{"class":48,"line":49},[46,806,419],{"class":52},[46,808,57],{"class":56},[46,810,61],{"class":60},[46,812,427],{"class":426},[46,814,450],{"class":430},[46,816,427],{"class":426},[46,818,68],{"class":60},[46,820,438],{"class":426},[46,822,823],{"class":430},"Apple",[46,825,427],{"class":426},[46,827,68],{"class":60},[46,829,438],{"class":426},[46,831,765],{"class":430},[46,833,427],{"class":426},[46,835,84],{"class":60},[46,837,838,840,842,844,846,848],{"class":48,"line":87},[46,839,91],{"class":90},[46,841,94],{"class":60},[46,843,97],{"class":90},[46,845,94],{"class":60},[46,847,467],{"class":102},[46,849,106],{"class":60},[20,851,143],{},[37,853,855],{"className":39,"code":854,"language":41,"meta":42,"style":42},"Apple\n",[15,856,857],{"__ignoreMap":42},[46,858,859],{"class":48,"line":49},[46,860,854],{"class":52},[20,862,863],{},"This may look surprising at first. Python compares characters by their internal order, so mixed letter case can change the result.",[20,865,866,867,507],{},"If you need all items in order instead of just the smallest one, see ",[501,868,870,873],{"href":869},"\u002Freference\u002Fpython-sorted-function-explained\u002F",[15,871,872],{},"sorted()"," explained",[32,875,578,877,879],{"id":876},"using-min-with-a-key-function",[15,878,17],{}," with a key function",[20,881,882,883,885],{},"The ",[15,884,408],{}," argument changes how items are compared.",[20,887,888],{},"Important points:",[172,890,891,896,901],{},[175,892,893,895],{},[15,894,408],{}," changes the comparison rule",[175,897,898,900],{},[15,899,17],{}," still returns the original item",[175,902,903],{},"This is useful for custom comparisons",[283,905,907],{"id":906},"find-the-shortest-string","Find the shortest string",[37,909,911],{"className":39,"code":910,"language":41,"meta":42,"style":42},"words = [\"elephant\", \"cat\", \"giraffe\"]\nprint(min(words, key=len))\n",[15,912,913,948],{"__ignoreMap":42},[46,914,915,917,919,921,923,926,928,930,932,935,937,939,941,944,946],{"class":48,"line":49},[46,916,419],{"class":52},[46,918,57],{"class":56},[46,920,61],{"class":60},[46,922,427],{"class":426},[46,924,925],{"class":430},"elephant",[46,927,427],{"class":426},[46,929,68],{"class":60},[46,931,438],{"class":426},[46,933,934],{"class":430},"cat",[46,936,427],{"class":426},[46,938,68],{"class":60},[46,940,438],{"class":426},[46,942,943],{"class":430},"giraffe",[46,945,427],{"class":426},[46,947,84],{"class":60},[46,949,950,952,954,956,958,960,962,964,966,968],{"class":48,"line":87},[46,951,91],{"class":90},[46,953,94],{"class":60},[46,955,97],{"class":90},[46,957,94],{"class":60},[46,959,467],{"class":102},[46,961,68],{"class":60},[46,963,255],{"class":254},[46,965,57],{"class":56},[46,967,476],{"class":90},[46,969,106],{"class":60},[20,971,143],{},[37,973,975],{"className":39,"code":974,"language":41,"meta":42,"style":42},"cat\n",[15,976,977],{"__ignoreMap":42},[46,978,979],{"class":48,"line":49},[46,980,974],{"class":52},[283,982,984],{"id":983},"find-the-dictionary-with-the-smallest-value","Find the dictionary with the smallest value",[37,986,988],{"className":39,"code":987,"language":41,"meta":42,"style":42},"students = [\n    {\"name\": \"Ana\", \"score\": 85},\n    {\"name\": \"Ben\", \"score\": 72},\n    {\"name\": \"Cara\", \"score\": 90}\n]\n\nlowest = min(students, key=lambda student: student[\"score\"])\nprint(lowest)\n",[15,989,990,1000,1038,1071,1106,1111,1116,1162],{"__ignoreMap":42},[46,991,992,995,997],{"class":48,"line":49},[46,993,994],{"class":52},"students ",[46,996,57],{"class":56},[46,998,999],{"class":60}," [\n",[46,1001,1002,1005,1007,1010,1012,1014,1016,1019,1021,1023,1025,1028,1030,1032,1035],{"class":48,"line":87},[46,1003,1004],{"class":60},"    {",[46,1006,427],{"class":426},[46,1008,1009],{"class":430},"name",[46,1011,427],{"class":426},[46,1013,198],{"class":60},[46,1015,438],{"class":426},[46,1017,1018],{"class":430},"Ana",[46,1020,427],{"class":426},[46,1022,68],{"class":60},[46,1024,438],{"class":426},[46,1026,1027],{"class":430},"score",[46,1029,427],{"class":426},[46,1031,198],{"class":60},[46,1033,1034],{"class":64}," 85",[46,1036,1037],{"class":60},"},\n",[46,1039,1040,1042,1044,1046,1048,1050,1052,1055,1057,1059,1061,1063,1065,1067,1069],{"class":48,"line":109},[46,1041,1004],{"class":60},[46,1043,427],{"class":426},[46,1045,1009],{"class":430},[46,1047,427],{"class":426},[46,1049,198],{"class":60},[46,1051,438],{"class":426},[46,1053,1054],{"class":430},"Ben",[46,1056,427],{"class":426},[46,1058,68],{"class":60},[46,1060,438],{"class":426},[46,1062,1027],{"class":430},[46,1064,427],{"class":426},[46,1066,198],{"class":60},[46,1068,608],{"class":64},[46,1070,1037],{"class":60},[46,1072,1073,1075,1077,1079,1081,1083,1085,1088,1090,1092,1094,1096,1098,1100,1103],{"class":48,"line":116},[46,1074,1004],{"class":60},[46,1076,427],{"class":426},[46,1078,1009],{"class":430},[46,1080,427],{"class":426},[46,1082,198],{"class":60},[46,1084,438],{"class":426},[46,1086,1087],{"class":430},"Cara",[46,1089,427],{"class":426},[46,1091,68],{"class":60},[46,1093,438],{"class":426},[46,1095,1027],{"class":430},[46,1097,427],{"class":426},[46,1099,198],{"class":60},[46,1101,1102],{"class":64}," 90",[46,1104,1105],{"class":60},"}\n",[46,1107,1109],{"class":48,"line":1108},5,[46,1110,84],{"class":60},[46,1112,1114],{"class":48,"line":1113},6,[46,1115,113],{"emptyLinePlaceholder":112},[46,1117,1119,1122,1124,1127,1129,1132,1134,1136,1138,1142,1146,1148,1150,1153,1155,1157,1159],{"class":48,"line":1118},7,[46,1120,1121],{"class":52},"lowest ",[46,1123,57],{"class":56},[46,1125,1126],{"class":90}," min",[46,1128,94],{"class":60},[46,1130,1131],{"class":102},"students",[46,1133,68],{"class":60},[46,1135,255],{"class":254},[46,1137,57],{"class":56},[46,1139,1141],{"class":1140},"sbsja","lambda",[46,1143,1145],{"class":1144},"sFwrP"," student",[46,1147,198],{"class":60},[46,1149,1145],{"class":102},[46,1151,1152],{"class":60},"[",[46,1154,427],{"class":426},[46,1156,1027],{"class":430},[46,1158,427],{"class":426},[46,1160,1161],{"class":60},"])\n",[46,1163,1165,1167,1169,1172],{"class":48,"line":1164},8,[46,1166,91],{"class":90},[46,1168,94],{"class":60},[46,1170,1171],{"class":102},"lowest",[46,1173,215],{"class":60},[20,1175,143],{},[37,1177,1179],{"className":39,"code":1178,"language":41,"meta":42,"style":42},"{'name': 'Ben', 'score': 72}\n",[15,1180,1181],{"__ignoreMap":42},[46,1182,1183,1186,1189,1191,1193,1195,1198,1200,1202,1204,1206,1208,1210,1212,1214],{"class":48,"line":49},[46,1184,1185],{"class":60},"{",[46,1187,1188],{"class":426},"'",[46,1190,1009],{"class":430},[46,1192,1188],{"class":426},[46,1194,198],{"class":60},[46,1196,1197],{"class":426}," '",[46,1199,1054],{"class":430},[46,1201,1188],{"class":426},[46,1203,68],{"class":60},[46,1205,1197],{"class":426},[46,1207,1027],{"class":430},[46,1209,1188],{"class":426},[46,1211,198],{"class":60},[46,1213,608],{"class":64},[46,1215,1105],{"class":60},[20,1217,1218,1219,1222],{},"Here, Python compares the ",[15,1220,1221],{},"\"score\""," values, but it returns the full dictionary.",[32,1224,578,1226,1228],{"id":1225},"using-default-with-empty-iterables",[15,1227,518],{}," with empty iterables",[20,1230,1231],{},"An empty iterable has no smallest item, so this causes an error:",[37,1233,1235],{"className":39,"code":1234,"language":41,"meta":42,"style":42},"numbers = []\nprint(min(numbers))\n",[15,1236,1237,1245],{"__ignoreMap":42},[46,1238,1239,1241,1243],{"class":48,"line":49},[46,1240,53],{"class":52},[46,1242,57],{"class":56},[46,1244,533],{"class":60},[46,1246,1247,1249,1251,1253,1255,1257],{"class":48,"line":87},[46,1248,91],{"class":90},[46,1250,94],{"class":60},[46,1252,97],{"class":90},[46,1254,94],{"class":60},[46,1256,103],{"class":102},[46,1258,106],{"class":60},[20,1260,143],{},[37,1262,1264],{"className":39,"code":1263,"language":41,"meta":42,"style":42},"ValueError: min() arg is an empty sequence\n",[15,1265,1266],{"__ignoreMap":42},[46,1267,1268,1271,1273,1275,1278,1281,1284],{"class":48,"line":49},[46,1269,573],{"class":1270},"sZMiF",[46,1272,198],{"class":60},[46,1274,1126],{"class":90},[46,1276,1277],{"class":60},"()",[46,1279,1280],{"class":52}," arg ",[46,1282,1283],{"class":56},"is",[46,1285,1286],{"class":52}," an empty sequence\n",[20,1288,1289,1290,198],{},"To avoid that, use ",[15,1291,518],{},[37,1293,1295],{"className":39,"code":1294,"language":41,"meta":42,"style":42},"numbers = []\nprint(min(numbers, default=None))\n",[15,1296,1297,1305],{"__ignoreMap":42},[46,1298,1299,1301,1303],{"class":48,"line":49},[46,1300,53],{"class":52},[46,1302,57],{"class":56},[46,1304,533],{"class":60},[46,1306,1307,1309,1311,1313,1315,1317,1319,1321,1323,1327],{"class":48,"line":87},[46,1308,91],{"class":90},[46,1310,94],{"class":60},[46,1312,97],{"class":90},[46,1314,94],{"class":60},[46,1316,103],{"class":102},[46,1318,68],{"class":60},[46,1320,275],{"class":254},[46,1322,57],{"class":56},[46,1324,1326],{"class":1325},"s39Yj","None",[46,1328,106],{"class":60},[20,1330,143],{},[37,1332,1334],{"className":39,"code":1333,"language":41,"meta":42,"style":42},"None\n",[15,1335,1336],{"__ignoreMap":42},[46,1337,1338],{"class":48,"line":49},[46,1339,1333],{"class":1325},[20,1341,1342],{},"This is helpful when your list may be empty and you want a safe fallback value.",[20,1344,1345],{},"Remember:",[172,1347,1348,1356],{},[175,1349,1350,1352,1353,1355],{},[15,1351,518],{}," works only when ",[15,1354,17],{}," gets one iterable argument",[175,1357,1358,1359],{},"It does not work with ",[15,1360,1361],{},"min(3, 5, default=0)",[20,1363,1364,1365,507],{},"If you want help with this error, see ",[501,1366,1368],{"href":1367},"\u002Ferrors\u002Fvalueerror-in-python-causes-and-fixes\u002F","ValueError in Python: causes and fixes",[32,1370,1372],{"id":1371},"common-errors-and-limits","Common errors and limits",[20,1374,1375,1376,507],{},"Here are the most common problems with ",[15,1377,17],{},[283,1379,1381,1382],{"id":1380},"empty-list-without-default","Empty list without ",[15,1383,518],{},[20,1385,1386,1387,198],{},"This raises a ",[15,1388,573],{},[37,1390,1392],{"className":39,"code":1391,"language":41,"meta":42,"style":42},"items = []\nprint(min(items))\n",[15,1393,1394,1403],{"__ignoreMap":42},[46,1395,1396,1399,1401],{"class":48,"line":49},[46,1397,1398],{"class":52},"items ",[46,1400,57],{"class":56},[46,1402,533],{"class":60},[46,1404,1405,1407,1409,1411,1413,1416],{"class":48,"line":87},[46,1406,91],{"class":90},[46,1408,94],{"class":60},[46,1410,97],{"class":90},[46,1412,94],{"class":60},[46,1414,1415],{"class":102},"items",[46,1417,106],{"class":60},[20,1419,1420],{},"Fix it by:",[172,1422,1423,1426],{},[175,1424,1425],{},"checking that the iterable is not empty first",[175,1427,1428,1429],{},"or using ",[15,1430,518],{},[37,1432,1434],{"className":39,"code":1433,"language":41,"meta":42,"style":42},"items = []\nprint(min(items, default=\"no items\"))\n",[15,1435,1436,1444],{"__ignoreMap":42},[46,1437,1438,1440,1442],{"class":48,"line":49},[46,1439,1398],{"class":52},[46,1441,57],{"class":56},[46,1443,533],{"class":60},[46,1445,1446,1448,1450,1452,1454,1456,1458,1460,1462,1464,1467,1469],{"class":48,"line":87},[46,1447,91],{"class":90},[46,1449,94],{"class":60},[46,1451,97],{"class":90},[46,1453,94],{"class":60},[46,1455,1415],{"class":102},[46,1457,68],{"class":60},[46,1459,275],{"class":254},[46,1461,57],{"class":56},[46,1463,427],{"class":426},[46,1465,1466],{"class":430},"no items",[46,1468,427],{"class":426},[46,1470,106],{"class":60},[283,1472,1474],{"id":1473},"mixed-types","Mixed types",[20,1476,1477],{},"In Python 3, values must usually be comparable to each other. This often fails:",[37,1479,1481],{"className":39,"code":1480,"language":41,"meta":42,"style":42},"data = [10, \"20\", 5]\nprint(min(data))\n",[15,1482,1483,1511],{"__ignoreMap":42},[46,1484,1485,1488,1490,1492,1495,1497,1499,1502,1504,1506,1509],{"class":48,"line":49},[46,1486,1487],{"class":52},"data ",[46,1489,57],{"class":56},[46,1491,61],{"class":60},[46,1493,1494],{"class":64},"10",[46,1496,68],{"class":60},[46,1498,438],{"class":426},[46,1500,1501],{"class":430},"20",[46,1503,427],{"class":426},[46,1505,68],{"class":60},[46,1507,1508],{"class":64}," 5",[46,1510,84],{"class":60},[46,1512,1513,1515,1517,1519,1521,1524],{"class":48,"line":87},[46,1514,91],{"class":90},[46,1516,94],{"class":60},[46,1518,97],{"class":90},[46,1520,94],{"class":60},[46,1522,1523],{"class":102},"data",[46,1525,106],{"class":60},[20,1527,143],{},[37,1529,1531],{"className":39,"code":1530,"language":41,"meta":42,"style":42},"TypeError\n",[15,1532,1533],{"__ignoreMap":42},[46,1534,1535],{"class":48,"line":49},[46,1536,1530],{"class":1270},[20,1538,1539],{},"That happens because Python cannot directly compare integers and strings here.",[20,1541,1542,1543,507],{},"A simple fix is to convert everything to the same type before calling ",[15,1544,17],{},[37,1546,1548],{"className":39,"code":1547,"language":41,"meta":42,"style":42},"data = [10, \"20\", 5]\nnumbers = [int(x) for x in data]\nprint(min(numbers))\n",[15,1549,1550,1574,1608],{"__ignoreMap":42},[46,1551,1552,1554,1556,1558,1560,1562,1564,1566,1568,1570,1572],{"class":48,"line":49},[46,1553,1487],{"class":52},[46,1555,57],{"class":56},[46,1557,61],{"class":60},[46,1559,1494],{"class":64},[46,1561,68],{"class":60},[46,1563,438],{"class":426},[46,1565,1501],{"class":430},[46,1567,427],{"class":426},[46,1569,68],{"class":60},[46,1571,1508],{"class":64},[46,1573,84],{"class":60},[46,1575,1576,1578,1580,1582,1585,1587,1590,1593,1597,1600,1603,1606],{"class":48,"line":87},[46,1577,53],{"class":52},[46,1579,57],{"class":56},[46,1581,61],{"class":60},[46,1583,1584],{"class":1270},"int",[46,1586,94],{"class":60},[46,1588,1589],{"class":102},"x",[46,1591,1592],{"class":60},")",[46,1594,1596],{"class":1595},"sVHd0"," for",[46,1598,1599],{"class":52}," x ",[46,1601,1602],{"class":1595},"in",[46,1604,1605],{"class":52}," data",[46,1607,84],{"class":60},[46,1609,1610,1612,1614,1616,1618,1620],{"class":48,"line":109},[46,1611,91],{"class":90},[46,1613,94],{"class":60},[46,1615,97],{"class":90},[46,1617,94],{"class":60},[46,1619,103],{"class":102},[46,1621,106],{"class":60},[20,1623,143],{},[37,1625,1627],{"className":39,"code":1626,"language":41,"meta":42,"style":42},"5\n",[15,1628,1629],{"__ignoreMap":42},[46,1630,1631],{"class":48,"line":49},[46,1632,1626],{"class":64},[20,1634,1635,1636,507],{},"For more help with type-related problems, see this guide to ",[15,1637,1638],{},"TypeError",[283,1640,1642],{"id":1641},"string-comparisons-may-not-match-your-expectation","String comparisons may not match your expectation",[20,1644,1645],{},"If strings have mixed uppercase and lowercase letters, the result may not match normal dictionary order.",[37,1647,1649],{"className":39,"code":1648,"language":41,"meta":42,"style":42},"words = [\"zebra\", \"Apple\", \"monkey\"]\nprint(min(words))\n",[15,1650,1651,1685],{"__ignoreMap":42},[46,1652,1653,1655,1657,1659,1661,1664,1666,1668,1670,1672,1674,1676,1678,1681,1683],{"class":48,"line":49},[46,1654,419],{"class":52},[46,1656,57],{"class":56},[46,1658,61],{"class":60},[46,1660,427],{"class":426},[46,1662,1663],{"class":430},"zebra",[46,1665,427],{"class":426},[46,1667,68],{"class":60},[46,1669,438],{"class":426},[46,1671,823],{"class":430},[46,1673,427],{"class":426},[46,1675,68],{"class":60},[46,1677,438],{"class":426},[46,1679,1680],{"class":430},"monkey",[46,1682,427],{"class":426},[46,1684,84],{"class":60},[46,1686,1687,1689,1691,1693,1695,1697],{"class":48,"line":87},[46,1688,91],{"class":90},[46,1690,94],{"class":60},[46,1692,97],{"class":90},[46,1694,94],{"class":60},[46,1696,467],{"class":102},[46,1698,106],{"class":60},[20,1700,143],{},[37,1702,1703],{"className":39,"code":854,"language":41,"meta":42,"style":42},[15,1704,1705],{"__ignoreMap":42},[46,1706,1707],{"class":48,"line":49},[46,1708,854],{"class":52},[20,1710,1711],{},"If needed, compare them in lowercase:",[37,1713,1715],{"className":39,"code":1714,"language":41,"meta":42,"style":42},"words = [\"zebra\", \"Apple\", \"monkey\"]\nprint(min(words, key=str.lower))\n",[15,1716,1717,1749],{"__ignoreMap":42},[46,1718,1719,1721,1723,1725,1727,1729,1731,1733,1735,1737,1739,1741,1743,1745,1747],{"class":48,"line":49},[46,1720,419],{"class":52},[46,1722,57],{"class":56},[46,1724,61],{"class":60},[46,1726,427],{"class":426},[46,1728,1663],{"class":430},[46,1730,427],{"class":426},[46,1732,68],{"class":60},[46,1734,438],{"class":426},[46,1736,823],{"class":430},[46,1738,427],{"class":426},[46,1740,68],{"class":60},[46,1742,438],{"class":426},[46,1744,1680],{"class":430},[46,1746,427],{"class":426},[46,1748,84],{"class":60},[46,1750,1751,1753,1755,1757,1759,1761,1763,1765,1767,1770,1772,1776],{"class":48,"line":87},[46,1752,91],{"class":90},[46,1754,94],{"class":60},[46,1756,97],{"class":90},[46,1758,94],{"class":60},[46,1760,467],{"class":102},[46,1762,68],{"class":60},[46,1764,255],{"class":254},[46,1766,57],{"class":56},[46,1768,1769],{"class":1270},"str",[46,1771,507],{"class":60},[46,1773,1775],{"class":1774},"skxfh","lower",[46,1777,106],{"class":60},[20,1779,143],{},[37,1781,1782],{"className":39,"code":854,"language":41,"meta":42,"style":42},[15,1783,1784],{"__ignoreMap":42},[46,1785,1786],{"class":48,"line":49},[46,1787,854],{"class":52},[20,1789,1790],{},"Here Python compares using lowercase versions, but still returns the original string.",[32,1792,1794,1795],{"id":1793},"when-to-use-min","When to use ",[15,1796,17],{},[20,1798,160,1799,1801],{},[15,1800,17],{}," when:",[172,1803,1804,1807,1812],{},[175,1805,1806],{},"you need the smallest item quickly",[175,1808,1809,1810],{},"you want to compare values with a custom rule using ",[15,1811,408],{},[175,1813,1814],{},"you want one result, not a full sorted list",[20,1816,160,1817,1821],{},[501,1818,1819],{"href":869},[15,1820,872],{}," if you need all items in order.",[20,1823,160,1824,1830],{},[501,1825,1827],{"href":1826},"\u002Freference\u002Fpython-max-function-explained\u002F",[15,1828,1829],{},"max()"," if you want the largest item instead.",[32,1832,1834],{"id":1833},"common-mistakes","Common mistakes",[20,1836,1837],{},"Beginners often run into these problems:",[172,1839,1840,1848,1851,1857,1865],{},[175,1841,1842,1843,1845,1846],{},"Passing an empty list or tuple to ",[15,1844,17],{}," without using ",[15,1847,518],{},[175,1849,1850],{},"Mixing incompatible types such as integers and strings",[175,1852,1853,1854,1856],{},"Expecting ",[15,1855,17],{}," on strings to ignore uppercase and lowercase differences",[175,1858,1859,1860,1862,1863,900],{},"Forgetting that ",[15,1861,408],{}," affects comparison but ",[15,1864,17],{},[175,1866,578,1867,1869],{},[15,1868,518],{}," in the wrong syntax form with multiple separate arguments",[20,1871,1872,1873,1875],{},"If you are debugging code that uses ",[15,1874,17],{},", these quick checks can help:",[37,1877,1879],{"className":39,"code":1878,"language":41,"meta":42,"style":42},"print(type(data))\nprint(data)\nprint(len(data))\nprint(min(data))\nprint(min(data, default=None))\nprint(min(words, key=len))\n",[15,1880,1881,1896,1906,1920,1934,1956],{"__ignoreMap":42},[46,1882,1883,1885,1887,1890,1892,1894],{"class":48,"line":49},[46,1884,91],{"class":90},[46,1886,94],{"class":60},[46,1888,1889],{"class":1270},"type",[46,1891,94],{"class":60},[46,1893,1523],{"class":102},[46,1895,106],{"class":60},[46,1897,1898,1900,1902,1904],{"class":48,"line":87},[46,1899,91],{"class":90},[46,1901,94],{"class":60},[46,1903,1523],{"class":102},[46,1905,215],{"class":60},[46,1907,1908,1910,1912,1914,1916,1918],{"class":48,"line":109},[46,1909,91],{"class":90},[46,1911,94],{"class":60},[46,1913,476],{"class":90},[46,1915,94],{"class":60},[46,1917,1523],{"class":102},[46,1919,106],{"class":60},[46,1921,1922,1924,1926,1928,1930,1932],{"class":48,"line":116},[46,1923,91],{"class":90},[46,1925,94],{"class":60},[46,1927,97],{"class":90},[46,1929,94],{"class":60},[46,1931,1523],{"class":102},[46,1933,106],{"class":60},[46,1935,1936,1938,1940,1942,1944,1946,1948,1950,1952,1954],{"class":48,"line":1108},[46,1937,91],{"class":90},[46,1939,94],{"class":60},[46,1941,97],{"class":90},[46,1943,94],{"class":60},[46,1945,1523],{"class":102},[46,1947,68],{"class":60},[46,1949,275],{"class":254},[46,1951,57],{"class":56},[46,1953,1326],{"class":1325},[46,1955,106],{"class":60},[46,1957,1958,1960,1962,1964,1966,1968,1970,1972,1974,1976],{"class":48,"line":1113},[46,1959,91],{"class":90},[46,1961,94],{"class":60},[46,1963,97],{"class":90},[46,1965,94],{"class":60},[46,1967,467],{"class":102},[46,1969,68],{"class":60},[46,1971,255],{"class":254},[46,1973,57],{"class":56},[46,1975,476],{"class":90},[46,1977,106],{"class":60},[20,1979,1980,1981,1984,1985,1987],{},"Use them carefully. For example, ",[15,1982,1983],{},"print(min(data))"," will still fail if ",[15,1986,1523],{}," is empty or contains incompatible types.",[32,1989,1991],{"id":1990},"faq","FAQ",[283,1993,1995,1996,1998],{"id":1994},"what-does-min-return-in-python","What does ",[15,1997,17],{}," return in Python?",[20,2000,2001],{},"It returns the smallest item from an iterable, or the smallest value from multiple arguments.",[283,2003,2005,2006,2008],{"id":2004},"can-min-work-with-strings","Can ",[15,2007,17],{}," work with strings?",[20,2010,2011],{},"Yes. It compares strings using character order, which is similar to alphabetical order but affected by letter case.",[283,2013,2015],{"id":2014},"what-happens-if-the-list-is-empty","What happens if the list is empty?",[20,2017,2018,2020,2021,2023,2024,2026],{},[15,2019,17],{}," raises a ",[15,2022,573],{}," unless you use the ",[15,2025,518],{}," argument.",[283,2028,1995,2030,2032,2033,2035],{"id":2029},"what-does-key-do-in-min",[15,2031,408],{}," do in ",[15,2034,17],{},"?",[20,2037,2038,2040,2041,2044],{},[15,2039,408],{}," tells Python how to compare items. For example, ",[15,2042,2043],{},"key=len"," compares strings by length.",[283,2046,2048,2049,2051,2052,2035],{"id":2047},"what-is-the-difference-between-min-and-sorted","What is the difference between ",[15,2050,17],{}," and ",[15,2053,872],{},[20,2055,2056,2058,2059,2061],{},[15,2057,17],{}," returns only the smallest item. ",[15,2060,872],{}," returns a new sorted list of all items.",[32,2063,2065],{"id":2064},"see-also","See also",[172,2067,2068,2074,2080,2086,2092,2098],{},[175,2069,2070],{},[501,2071,2072,506],{"href":1826},[15,2073,1829],{},[175,2075,2076],{},[501,2077,2078,506],{"href":869},[15,2079,872],{},[175,2081,2082],{},[501,2083,2084,506],{"href":503},[15,2085,498],{},[175,2087,2088],{},[501,2089,2091],{"href":2090},"\u002Fhow-to\u002Fhow-to-sort-a-list-in-python\u002F","How to sort a list in Python",[175,2093,2094],{},[501,2095,2097],{"href":2096},"\u002Fhow-to\u002Fhow-to-find-an-item-in-a-list-in-python\u002F","How to find an item in a list in Python",[175,2099,2100],{},[501,2101,1368],{"href":1367},[2103,2104,2105],"style",{},"html pre.shiki code .su5hD, html code.shiki .su5hD{--shiki-light:#90A4AE;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .smGrS, html code.shiki .smGrS{--shiki-light:#39ADB5;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sP7_E, html code.shiki .sP7_E{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .srdBf, html code.shiki .srdBf{--shiki-light:#F76D47;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sptTA, html code.shiki .sptTA{--shiki-light:#6182B8;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .slqww, html code.shiki .slqww{--shiki-light:#6182B8;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s99_P, html code.shiki .s99_P{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#E36209;--shiki-default-font-style:inherit;--shiki-dark:#FFAB70;--shiki-dark-font-style:inherit}html pre.shiki code .sjJ54, html code.shiki .sjJ54{--shiki-light:#39ADB5;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .s_sjI, html code.shiki .s_sjI{--shiki-light:#91B859;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sbsja, html code.shiki .sbsja{--shiki-light:#9C3EDA;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sFwrP, html code.shiki .sFwrP{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#24292E;--shiki-default-font-style:inherit;--shiki-dark:#E1E4E8;--shiki-dark-font-style:inherit}html pre.shiki code .sZMiF, html code.shiki .sZMiF{--shiki-light:#E2931D;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .s39Yj, html code.shiki .s39Yj{--shiki-light:#39ADB5;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sVHd0, html code.shiki .sVHd0{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#D73A49;--shiki-default-font-style:inherit;--shiki-dark:#F97583;--shiki-dark-font-style:inherit}html pre.shiki code .skxfh, html code.shiki .skxfh{--shiki-light:#E53935;--shiki-default:#24292E;--shiki-dark:#E1E4E8}",{"title":42,"searchDepth":87,"depth":87,"links":2107},[2108,2109,2111,2117,2119,2121,2126,2128,2134,2136,2137,2148],{"id":34,"depth":87,"text":35},{"id":166,"depth":87,"text":2110},"What min() does",{"id":191,"depth":87,"text":192,"children":2112},[2113,2114,2115,2116],{"id":285,"depth":109,"text":288},{"id":350,"depth":109,"text":353},{"id":400,"depth":109,"text":403},{"id":510,"depth":109,"text":513},{"id":577,"depth":87,"text":2118},"Using min() with numbers",{"id":722,"depth":87,"text":2120},"Using min() with strings",{"id":876,"depth":87,"text":2122,"children":2123},"Using min() with a key function",[2124,2125],{"id":906,"depth":109,"text":907},{"id":983,"depth":109,"text":984},{"id":1225,"depth":87,"text":2127},"Using default with empty iterables",{"id":1371,"depth":87,"text":1372,"children":2129},[2130,2132,2133],{"id":1380,"depth":109,"text":2131},"Empty list without default",{"id":1473,"depth":109,"text":1474},{"id":1641,"depth":109,"text":1642},{"id":1793,"depth":87,"text":2135},"When to use min()",{"id":1833,"depth":87,"text":1834},{"id":1990,"depth":87,"text":1991,"children":2138},[2139,2141,2143,2144,2146],{"id":1994,"depth":109,"text":2140},"What does min() return in Python?",{"id":2004,"depth":109,"text":2142},"Can min() work with strings?",{"id":2014,"depth":109,"text":2015},{"id":2029,"depth":109,"text":2145},"What does key do in min()?",{"id":2047,"depth":109,"text":2147},"What is the difference between min() and sorted()?",{"id":2064,"depth":87,"text":2065},"Master python min function explained in our comprehensive Python beginner guide.","md",{},"\u002Freference\u002Fpython-min-function-explained",{"title":5,"description":2149},"reference\u002Fpython-min-function-explained","VRpvwOyAjT3zttFenYN7xvkjWchE8ws8iWzCuhgc8Cs",1777585489603]