[{"data":1,"prerenderedAt":1165},["ShallowReactive",2],{"doc-\u002Fglossary\u002Fwhat-is-a-function-in-python":3},{"id":4,"title":5,"body":6,"description":1158,"extension":1159,"meta":1160,"navigation":102,"path":1161,"seo":1162,"stem":1163,"__hash__":1164},"content\u002Fglossary\u002Fwhat-is-a-function-in-python.md","What Is a Function in Python?",{"type":7,"value":8,"toc":1139},"minimark",[9,13,17,20,25,28,44,47,114,117,127,130,147,158,162,165,179,182,186,189,205,208,248,250,267,270,291,299,303,306,325,327,405,407,430,433,450,453,457,463,487,489,566,568,577,580,599,602,673,675,690,697,704,708,711,727,729,767,769,778,783,786,802,812,816,819,833,840,844,847,869,872,899,902,938,941,1001,1004,1042,1050,1054,1059,1062,1066,1069,1073,1076,1083,1089,1093,1096,1100,1132,1135],[10,11,5],"h1",{"id":12},"what-is-a-function-in-python",[14,15,16],"p",{},"A function in Python is a reusable block of code that does a specific task. You can run it when needed, and it can optionally send a value back.",[14,18,19],{},"Functions are one of the main ways to organize code. They help you group related steps together and avoid writing the same code again and again.",[21,22,24],"h2",{"id":23},"simple-definition","Simple definition",[14,26,27],{},"A function is:",[29,30,31,35,38,41],"ul",{},[32,33,34],"li",{},"A named block of code",[32,36,37],{},"A way to group steps that belong together",[32,39,40],{},"Something you can run more than once",[32,42,43],{},"A tool for avoiding repeated code",[14,45,46],{},"Here is a very simple example:",[48,49,54],"pre",{"className":50,"code":51,"language":52,"meta":53,"style":53},"language-python shiki shiki-themes material-theme-lighter github-light github-dark","def say_hello():\n    print(\"Hello\")\n\nsay_hello()\n","python","",[55,56,57,74,97,104],"code",{"__ignoreMap":53},[58,59,62,66,70],"span",{"class":60,"line":61},"line",1,[58,63,65],{"class":64},"sbsja","def",[58,67,69],{"class":68},"sGLFI"," say_hello",[58,71,73],{"class":72},"sP7_E","():\n",[58,75,77,81,84,88,92,94],{"class":60,"line":76},2,[58,78,80],{"class":79},"sptTA","    print",[58,82,83],{"class":72},"(",[58,85,87],{"class":86},"sjJ54","\"",[58,89,91],{"class":90},"s_sjI","Hello",[58,93,87],{"class":86},[58,95,96],{"class":72},")\n",[58,98,100],{"class":60,"line":99},3,[58,101,103],{"emptyLinePlaceholder":102},true,"\n",[58,105,107,111],{"class":60,"line":106},4,[58,108,110],{"class":109},"slqww","say_hello",[58,112,113],{"class":72},"()\n",[14,115,116],{},"Output:",[48,118,120],{"className":50,"code":119,"language":52,"meta":53,"style":53},"Hello\n",[55,121,122],{"__ignoreMap":53},[58,123,124],{"class":60,"line":61},[58,125,119],{"class":126},"su5hD",[14,128,129],{},"This example shows the two main parts:",[29,131,132,141],{},[32,133,134,138,139],{},[135,136,137],"strong",{},"Defining"," a function with ",[55,140,65],{},[32,142,143,146],{},[135,144,145],{},"Calling"," the function by writing its name with parentheses",[14,148,149,150,153,154,157],{},"The function does not run when Python first sees ",[55,151,152],{},"def say_hello():",". It runs only when you call ",[55,155,156],{},"say_hello()",".",[21,159,161],{"id":160},"why-functions-are-useful","Why functions are useful",[14,163,164],{},"Functions are useful because they help you:",[29,166,167,170,173,176],{},[32,168,169],{},"Make code easier to read",[32,171,172],{},"Reduce repetition",[32,174,175],{},"Break large problems into smaller parts",[32,177,178],{},"Reuse the same logic in different places",[14,180,181],{},"For example, without a function, you might repeat the same lines several times. With a function, you write the code once and call it whenever you need it.",[21,183,185],{"id":184},"how-a-function-works","How a function works",[14,187,188],{},"A basic function works like this:",[29,190,191,196,199,202],{},[32,192,193,194],{},"You define a function with ",[55,195,65],{},[32,197,198],{},"You give the function a name",[32,200,201],{},"You put the code for that task inside the function",[32,203,204],{},"The indented code runs when the function is called",[14,206,207],{},"Example:",[48,209,211],{"className":50,"code":210,"language":52,"meta":53,"style":53},"def show_message():\n    print(\"This is inside the function\")\n\nshow_message()\n",[55,212,213,222,237,241],{"__ignoreMap":53},[58,214,215,217,220],{"class":60,"line":61},[58,216,65],{"class":64},[58,218,219],{"class":68}," show_message",[58,221,73],{"class":72},[58,223,224,226,228,230,233,235],{"class":60,"line":76},[58,225,80],{"class":79},[58,227,83],{"class":72},[58,229,87],{"class":86},[58,231,232],{"class":90},"This is inside the function",[58,234,87],{"class":86},[58,236,96],{"class":72},[58,238,239],{"class":60,"line":99},[58,240,103],{"emptyLinePlaceholder":102},[58,242,243,246],{"class":60,"line":106},[58,244,245],{"class":109},"show_message",[58,247,113],{"class":72},[14,249,116],{},[48,251,253],{"className":50,"code":252,"language":52,"meta":53,"style":53},"This is inside the function\n",[55,254,255],{"__ignoreMap":53},[58,256,257,260,264],{"class":60,"line":61},[58,258,259],{"class":126},"This ",[58,261,263],{"class":262},"smGrS","is",[58,265,266],{"class":126}," inside the function\n",[14,268,269],{},"Key parts:",[29,271,272,277,282,288],{},[32,273,274,276],{},[55,275,65],{}," starts the function definition",[32,278,279,281],{},[55,280,245],{}," is the function name",[32,283,284,287],{},[55,285,286],{},"()"," are used in both the definition and the call",[32,289,290],{},"The indented line is the function body",[14,292,293,294,157],{},"If you want a fuller introduction, see ",[295,296,298],"a",{"href":297},"\u002Flearn\u002Fpython-functions-explained\u002F","Python functions explained",[21,300,302],{"id":301},"functions-can-take-input","Functions can take input",[14,304,305],{},"Functions can work with different data by taking input.",[29,307,308,315,322],{},[32,309,310,311],{},"Inputs in the function definition are called ",[295,312,314],{"href":313},"\u002Fglossary\u002Fwhat-is-a-parameter-in-python\u002F","parameters",[32,316,317,318],{},"Values you pass when calling the function are called ",[295,319,321],{"href":320},"\u002Fglossary\u002Fwhat-is-an-argument-in-python\u002F","arguments",[32,323,324],{},"This lets one function work with different values",[14,326,207],{},[48,328,330],{"className":50,"code":329,"language":52,"meta":53,"style":53},"def greet(name):\n    print(\"Hello,\", name)\n\ngreet(\"Maya\")\ngreet(\"Leo\")\n",[55,331,332,348,369,373,389],{"__ignoreMap":53},[58,333,334,336,339,341,345],{"class":60,"line":61},[58,335,65],{"class":64},[58,337,338],{"class":68}," greet",[58,340,83],{"class":72},[58,342,344],{"class":343},"sFwrP","name",[58,346,347],{"class":72},"):\n",[58,349,350,352,354,356,359,361,364,367],{"class":60,"line":76},[58,351,80],{"class":79},[58,353,83],{"class":72},[58,355,87],{"class":86},[58,357,358],{"class":90},"Hello,",[58,360,87],{"class":86},[58,362,363],{"class":72},",",[58,365,366],{"class":109}," name",[58,368,96],{"class":72},[58,370,371],{"class":60,"line":99},[58,372,103],{"emptyLinePlaceholder":102},[58,374,375,378,380,382,385,387],{"class":60,"line":106},[58,376,377],{"class":109},"greet",[58,379,83],{"class":72},[58,381,87],{"class":86},[58,383,384],{"class":90},"Maya",[58,386,87],{"class":86},[58,388,96],{"class":72},[58,390,392,394,396,398,401,403],{"class":60,"line":391},5,[58,393,377],{"class":109},[58,395,83],{"class":72},[58,397,87],{"class":86},[58,399,400],{"class":90},"Leo",[58,402,87],{"class":86},[58,404,96],{"class":72},[14,406,116],{},[48,408,410],{"className":50,"code":409,"language":52,"meta":53,"style":53},"Hello, Maya\nHello, Leo\n",[55,411,412,421],{"__ignoreMap":53},[58,413,414,416,418],{"class":60,"line":61},[58,415,91],{"class":126},[58,417,363],{"class":72},[58,419,420],{"class":126}," Maya\n",[58,422,423,425,427],{"class":60,"line":76},[58,424,91],{"class":126},[58,426,363],{"class":72},[58,428,429],{"class":126}," Leo\n",[14,431,432],{},"Here:",[29,434,435,440],{},[32,436,437,439],{},[55,438,344],{}," is a parameter",[32,441,442,445,446,449],{},[55,443,444],{},"\"Maya\""," and ",[55,447,448],{},"\"Leo\""," are arguments",[14,451,452],{},"This is useful because you do not need a separate function for every person or value.",[21,454,456],{"id":455},"functions-can-return-output","Functions can return output",[14,458,459,460,157],{},"A function can also send a value back using ",[55,461,462],{},"return",[29,464,465,470,473,478],{},[32,466,467,469],{},[55,468,462],{}," gives a value back to the program",[32,471,472],{},"The returned value can be stored in a variable",[32,474,475,476],{},"Not every function needs ",[55,477,462],{},[32,479,480,483,484,486],{},[55,481,482],{},"print()"," shows something on the screen, but ",[55,485,462],{}," gives a value back to your code",[14,488,207],{},[48,490,492],{"className":50,"code":491,"language":52,"meta":53,"style":53},"def add_numbers(a, b):\n    return a + b\n\nresult = add_numbers(2, 3)\nprint(result)\n",[55,493,494,512,527,531,554],{"__ignoreMap":53},[58,495,496,498,501,503,505,507,510],{"class":60,"line":61},[58,497,65],{"class":64},[58,499,500],{"class":68}," add_numbers",[58,502,83],{"class":72},[58,504,295],{"class":343},[58,506,363],{"class":72},[58,508,509],{"class":343}," b",[58,511,347],{"class":72},[58,513,514,518,521,524],{"class":60,"line":76},[58,515,517],{"class":516},"sVHd0","    return",[58,519,520],{"class":126}," a ",[58,522,523],{"class":262},"+",[58,525,526],{"class":126}," b\n",[58,528,529],{"class":60,"line":99},[58,530,103],{"emptyLinePlaceholder":102},[58,532,533,536,539,541,543,547,549,552],{"class":60,"line":106},[58,534,535],{"class":126},"result ",[58,537,538],{"class":262},"=",[58,540,500],{"class":109},[58,542,83],{"class":72},[58,544,546],{"class":545},"srdBf","2",[58,548,363],{"class":72},[58,550,551],{"class":545}," 3",[58,553,96],{"class":72},[58,555,556,559,561,564],{"class":60,"line":391},[58,557,558],{"class":79},"print",[58,560,83],{"class":72},[58,562,563],{"class":109},"result",[58,565,96],{"class":72},[14,567,116],{},[48,569,571],{"className":50,"code":570,"language":52,"meta":53,"style":53},"5\n",[55,572,573],{"__ignoreMap":53},[58,574,575],{"class":60,"line":61},[58,576,570],{"class":545},[14,578,579],{},"In this example:",[29,581,582,588,594],{},[32,583,584,585],{},"The function calculates ",[55,586,587],{},"a + b",[32,589,590,593],{},[55,591,592],{},"return a + b"," sends the result back",[32,595,596,597],{},"That result is stored in ",[55,598,563],{},[14,600,601],{},"This is different from:",[48,603,605],{"className":50,"code":604,"language":52,"meta":53,"style":53},"def add_and_print(a, b):\n    print(a + b)\n\nvalue = add_and_print(2, 3)\nprint(value)\n",[55,606,607,624,639,643,662],{"__ignoreMap":53},[58,608,609,611,614,616,618,620,622],{"class":60,"line":61},[58,610,65],{"class":64},[58,612,613],{"class":68}," add_and_print",[58,615,83],{"class":72},[58,617,295],{"class":343},[58,619,363],{"class":72},[58,621,509],{"class":343},[58,623,347],{"class":72},[58,625,626,628,630,633,635,637],{"class":60,"line":76},[58,627,80],{"class":79},[58,629,83],{"class":72},[58,631,632],{"class":109},"a ",[58,634,523],{"class":262},[58,636,509],{"class":109},[58,638,96],{"class":72},[58,640,641],{"class":60,"line":99},[58,642,103],{"emptyLinePlaceholder":102},[58,644,645,648,650,652,654,656,658,660],{"class":60,"line":106},[58,646,647],{"class":126},"value ",[58,649,538],{"class":262},[58,651,613],{"class":109},[58,653,83],{"class":72},[58,655,546],{"class":545},[58,657,363],{"class":72},[58,659,551],{"class":545},[58,661,96],{"class":72},[58,663,664,666,668,671],{"class":60,"line":391},[58,665,558],{"class":79},[58,667,83],{"class":72},[58,669,670],{"class":109},"value",[58,672,96],{"class":72},[14,674,116],{},[48,676,678],{"className":50,"code":677,"language":52,"meta":53,"style":53},"5\nNone\n",[55,679,680,684],{"__ignoreMap":53},[58,681,682],{"class":60,"line":61},[58,683,570],{"class":545},[58,685,686],{"class":60,"line":76},[58,687,689],{"class":688},"s39Yj","None\n",[14,691,692,693,696],{},"Why does ",[55,694,695],{},"None"," appear? Because the function printed the result, but it did not return one.",[14,698,699,700,157],{},"If you want to learn this idea in more detail, see ",[295,701,703],{"href":702},"\u002Fglossary\u002Fwhat-is-a-return-value-in-python\u002F","what is a return value in Python",[21,705,707],{"id":706},"built-in-functions-and-your-own-functions","Built-in functions and your own functions",[14,709,710],{},"Python already includes many built-in functions, such as:",[29,712,713,717,722],{},[32,714,715],{},[55,716,482],{},[32,718,719],{},[55,720,721],{},"len()",[32,723,724],{},[55,725,726],{},"input()",[14,728,207],{},[48,730,732],{"className":50,"code":731,"language":52,"meta":53,"style":53},"text = \"Python\"\nprint(len(text))\n",[55,733,734,750],{"__ignoreMap":53},[58,735,736,739,741,744,747],{"class":60,"line":61},[58,737,738],{"class":126},"text ",[58,740,538],{"class":262},[58,742,743],{"class":86}," \"",[58,745,746],{"class":90},"Python",[58,748,749],{"class":86},"\"\n",[58,751,752,754,756,759,761,764],{"class":60,"line":76},[58,753,558],{"class":79},[58,755,83],{"class":72},[58,757,758],{"class":79},"len",[58,760,83],{"class":72},[58,762,763],{"class":109},"text",[58,765,766],{"class":72},"))\n",[14,768,116],{},[48,770,772],{"className":50,"code":771,"language":52,"meta":53,"style":53},"6\n",[55,773,774],{"__ignoreMap":53},[58,775,776],{"class":60,"line":61},[58,777,771],{"class":545},[14,779,780,781,157],{},"You can also create your own functions with ",[55,782,65],{},[14,784,785],{},"Both built-in functions and your own functions are usually called with parentheses. For example:",[29,787,788,793,798],{},[32,789,790],{},[55,791,792],{},"print(\"Hi\")",[32,794,795],{},[55,796,797],{},"len(\"cat\")",[32,799,800],{},[55,801,156],{},[14,803,804,805,157],{},"If you want to understand one common built-in function better, see ",[295,806,808,809,811],{"href":807},"\u002Freference\u002Fpython-print-function-explained\u002F","Python ",[55,810,482],{}," function explained",[21,813,815],{"id":814},"what-this-page-does-not-cover-in-depth","What this page does not cover in depth",[14,817,818],{},"This page explains the basic idea of a function. It does not go deeply into:",[29,820,821,824,827,830],{},[32,822,823],{},"Detailed parameter rules",[32,825,826],{},"Default arguments and keyword arguments",[32,828,829],{},"Lambda functions",[32,831,832],{},"Advanced function concepts",[14,834,835,836,157],{},"If your next goal is to make one yourself, see ",[295,837,839],{"href":838},"\u002Fhow-to\u002Fhow-to-create-a-simple-function-in-python\u002F","how to create a simple function in Python",[21,841,843],{"id":842},"common-mistakes","Common mistakes",[14,845,846],{},"Beginners often run into these problems when learning functions:",[29,848,849,852,855,863,866],{},[32,850,851],{},"Thinking a function runs as soon as it is defined",[32,853,854],{},"Forgetting to call the function after defining it",[32,856,857,858,860,861],{},"Confusing ",[55,859,482],{}," with ",[55,862,462],{},[32,864,865],{},"Forgetting the parentheses when calling a function",[32,867,868],{},"Using wrong indentation inside the function body",[14,870,871],{},"Example of a function that is defined but not called:",[48,873,875],{"className":50,"code":874,"language":52,"meta":53,"style":53},"def say_hello():\n    print(\"Hello\")\n",[55,876,877,885],{"__ignoreMap":53},[58,878,879,881,883],{"class":60,"line":61},[58,880,65],{"class":64},[58,882,69],{"class":68},[58,884,73],{"class":72},[58,886,887,889,891,893,895,897],{"class":60,"line":76},[58,888,80],{"class":79},[58,890,83],{"class":72},[58,892,87],{"class":86},[58,894,91],{"class":90},[58,896,87],{"class":86},[58,898,96],{"class":72},[14,900,901],{},"This code creates the function, but it does not produce output yet. To run it, you must call it:",[48,903,904],{"className":50,"code":51,"language":52,"meta":53,"style":53},[55,905,906,914,928,932],{"__ignoreMap":53},[58,907,908,910,912],{"class":60,"line":61},[58,909,65],{"class":64},[58,911,69],{"class":68},[58,913,73],{"class":72},[58,915,916,918,920,922,924,926],{"class":60,"line":76},[58,917,80],{"class":79},[58,919,83],{"class":72},[58,921,87],{"class":86},[58,923,91],{"class":90},[58,925,87],{"class":86},[58,927,96],{"class":72},[58,929,930],{"class":60,"line":99},[58,931,103],{"emptyLinePlaceholder":102},[58,933,934,936],{"class":60,"line":106},[58,935,110],{"class":109},[58,937,113],{"class":72},[14,939,940],{},"You can also use a few quick checks while learning:",[48,942,944],{"className":50,"code":943,"language":52,"meta":53,"style":53},"print(my_function)\nprint(my_function())\nhelp(print)\ntype(print)\ntype(my_function)\n",[55,945,946,957,968,979,991],{"__ignoreMap":53},[58,947,948,950,952,955],{"class":60,"line":61},[58,949,558],{"class":79},[58,951,83],{"class":72},[58,953,954],{"class":109},"my_function",[58,956,96],{"class":72},[58,958,959,961,963,965],{"class":60,"line":76},[58,960,558],{"class":79},[58,962,83],{"class":72},[58,964,954],{"class":109},[58,966,967],{"class":72},"())\n",[58,969,970,973,975,977],{"class":60,"line":99},[58,971,972],{"class":79},"help",[58,974,83],{"class":72},[58,976,558],{"class":79},[58,978,96],{"class":72},[58,980,981,985,987,989],{"class":60,"line":106},[58,982,984],{"class":983},"sZMiF","type",[58,986,83],{"class":72},[58,988,558],{"class":79},[58,990,96],{"class":72},[58,992,993,995,997,999],{"class":60,"line":391},[58,994,984],{"class":983},[58,996,83],{"class":72},[58,998,954],{"class":109},[58,1000,96],{"class":72},[14,1002,1003],{},"What these show:",[29,1005,1006,1012,1018,1027,1036],{},[32,1007,1008,1011],{},[55,1009,1010],{},"print(my_function)"," shows that the function exists",[32,1013,1014,1017],{},[55,1015,1016],{},"print(my_function())"," calls the function and prints its return value",[32,1019,1020,1023,1024,1026],{},[55,1021,1022],{},"help(print)"," shows help for the built-in ",[55,1025,482],{}," function",[32,1028,1029,1032,1033,1035],{},[55,1030,1031],{},"type(print)"," shows that ",[55,1034,558],{}," is a built-in function",[32,1037,1038,1041],{},[55,1039,1040],{},"type(my_function)"," shows that your function is a function object",[14,1043,1044,1045,1047,1048,157],{},"Be careful with ",[55,1046,1016],{},": it runs the function. If the function only prints something and does not return a value, you may also see ",[55,1049,695],{},[21,1051,1053],{"id":1052},"faq","FAQ",[1055,1056,1058],"h3",{"id":1057},"what-is-a-function-in-simple-words","What is a function in simple words?",[14,1060,1061],{},"A function is a reusable set of instructions that performs a task.",[1055,1063,1065],{"id":1064},"what-is-the-difference-between-defining-and-calling-a-function","What is the difference between defining and calling a function?",[14,1067,1068],{},"Defining creates the function. Calling runs it.",[1055,1070,1072],{"id":1071},"does-every-function-need-a-return-statement","Does every function need a return statement?",[14,1074,1075],{},"No. Some functions only perform an action, such as printing output.",[1055,1077,1079,1080,1082],{"id":1078},"is-print-a-function","Is ",[55,1081,482],{}," a function?",[14,1084,1085,1086,1088],{},"Yes. ",[55,1087,482],{}," is a built-in Python function.",[1055,1090,1092],{"id":1091},"why-should-beginners-use-functions","Why should beginners use functions?",[14,1094,1095],{},"Functions make code easier to reuse, organize, and understand.",[21,1097,1099],{"id":1098},"see-also","See also",[29,1101,1102,1106,1111,1116,1121,1126],{},[32,1103,1104],{},[295,1105,298],{"href":297},[32,1107,1108],{},[295,1109,1110],{"href":313},"What is a parameter in Python?",[32,1112,1113],{},[295,1114,1115],{"href":320},"What is an argument in Python?",[32,1117,1118],{},[295,1119,1120],{"href":702},"What is a return value in Python?",[32,1122,1123],{},[295,1124,1125],{"href":838},"How to create a simple function in Python",[32,1127,1128],{},[295,1129,808,1130,811],{"href":807},[55,1131,482],{},[14,1133,1134],{},"Next step: learn how to create your own function, pass values into it, and get a result back.",[1136,1137,1138],"style",{},"html pre.shiki code .sbsja, html code.shiki .sbsja{--shiki-light:#9C3EDA;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sGLFI, html code.shiki .sGLFI{--shiki-light:#6182B8;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sP7_E, html code.shiki .sP7_E{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sptTA, html code.shiki .sptTA{--shiki-light:#6182B8;--shiki-default:#005CC5;--shiki-dark:#79B8FF}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 .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 .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 .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 .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 .srdBf, html code.shiki .srdBf{--shiki-light:#F76D47;--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 .sZMiF, html code.shiki .sZMiF{--shiki-light:#E2931D;--shiki-default:#005CC5;--shiki-dark:#79B8FF}",{"title":53,"searchDepth":76,"depth":76,"links":1140},[1141,1142,1143,1144,1145,1146,1147,1148,1149,1157],{"id":23,"depth":76,"text":24},{"id":160,"depth":76,"text":161},{"id":184,"depth":76,"text":185},{"id":301,"depth":76,"text":302},{"id":455,"depth":76,"text":456},{"id":706,"depth":76,"text":707},{"id":814,"depth":76,"text":815},{"id":842,"depth":76,"text":843},{"id":1052,"depth":76,"text":1053,"children":1150},[1151,1152,1153,1154,1156],{"id":1057,"depth":99,"text":1058},{"id":1064,"depth":99,"text":1065},{"id":1071,"depth":99,"text":1072},{"id":1078,"depth":99,"text":1155},"Is print() a function?",{"id":1091,"depth":99,"text":1092},{"id":1098,"depth":76,"text":1099},"Master what is a function in python in our comprehensive Python beginner guide.","md",{},"\u002Fglossary\u002Fwhat-is-a-function-in-python",{"title":5,"description":1158},"glossary\u002Fwhat-is-a-function-in-python","ox27Rb0rBNXGTNmCFtfm2MEG3Gl_Soqb6b10lgkKaZ4",1777585495261]