[{"data":1,"prerenderedAt":1389},["ShallowReactive",2],{"doc-\u002Fglossary\u002Fwhat-is-an-argument-in-python":3},{"id":4,"title":5,"body":6,"description":1382,"extension":1383,"meta":1384,"navigation":120,"path":1385,"seo":1386,"stem":1387,"__hash__":1388},"content\u002Fglossary\u002Fwhat-is-an-argument-in-python.md","What Is an Argument in Python?",{"type":7,"value":8,"toc":1357},"minimark",[9,13,22,25,36,52,139,148,153,164,167,187,198,202,205,237,240,292,295,307,319,323,326,337,339,424,427,448,451,455,460,466,528,530,539,542,559,562,566,572,645,647,655,662,666,669,738,740,754,758,761,775,778,838,841,867,874,878,882,902,908,912,967,969,978,986,990,1061,1063,1076,1079,1083,1123,1126,1130,1133,1152,1155,1200,1206,1216,1219,1282,1285,1289,1293,1296,1300,1303,1307,1310,1314,1317,1321,1350,1353],[10,11,5],"h1",{"id":12},"what-is-an-argument-in-python",[14,15,16,17,21],"p",{},"An ",[18,19,20],"strong",{},"argument"," in Python is a value you pass to a function when you call it.",[14,23,24],{},"This helps the function work with real data. For example, a function can greet different people, add different numbers, or print different messages based on the arguments you give it.",[14,26,27,28,31,32,35],{},"A common beginner confusion is the difference between ",[18,29,30],{},"arguments"," and ",[18,33,34],{},"parameters",":",[37,38,39,46],"ul",{},[40,41,42,45],"li",{},[18,43,44],{},"Parameters"," are the names written in the function definition.",[40,47,48,51],{},[18,49,50],{},"Arguments"," are the actual values passed into the function call.",[53,54,59],"pre",{"className":55,"code":56,"language":57,"meta":58,"style":58},"language-python shiki shiki-themes material-theme-lighter github-light github-dark","def greet(name):\n    print(\"Hello\", name)\n\ngreet(\"Sam\")\n","python","",[60,61,62,86,115,122],"code",{"__ignoreMap":58},[63,64,67,71,75,79,83],"span",{"class":65,"line":66},"line",1,[63,68,70],{"class":69},"sbsja","def",[63,72,74],{"class":73},"sGLFI"," greet",[63,76,78],{"class":77},"sP7_E","(",[63,80,82],{"class":81},"sFwrP","name",[63,84,85],{"class":77},"):\n",[63,87,89,93,95,99,103,105,108,112],{"class":65,"line":88},2,[63,90,92],{"class":91},"sptTA","    print",[63,94,78],{"class":77},[63,96,98],{"class":97},"sjJ54","\"",[63,100,102],{"class":101},"s_sjI","Hello",[63,104,98],{"class":97},[63,106,107],{"class":77},",",[63,109,111],{"class":110},"slqww"," name",[63,113,114],{"class":77},")\n",[63,116,118],{"class":65,"line":117},3,[63,119,121],{"emptyLinePlaceholder":120},true,"\n",[63,123,125,128,130,132,135,137],{"class":65,"line":124},4,[63,126,127],{"class":110},"greet",[63,129,78],{"class":77},[63,131,98],{"class":97},[63,133,134],{"class":101},"Sam",[63,136,98],{"class":97},[63,138,114],{"class":77},[14,140,141,144,145,147],{},[60,142,143],{},"\"Sam\""," is the ",[18,146,20],{},". It is the value passed to the function.",[149,150,152],"h2",{"id":151},"simple-definition","Simple definition",[37,154,155,158,161],{},[40,156,157],{},"An argument is a value you give to a function when you call it.",[40,159,160],{},"The function uses that value while it runs.",[40,162,163],{},"Arguments go inside the parentheses after the function name.",[14,165,166],{},"For example:",[53,168,170],{"className":55,"code":169,"language":57,"meta":58,"style":58},"print(\"Hello\")\n",[60,171,172],{"__ignoreMap":58},[63,173,174,177,179,181,183,185],{"class":65,"line":66},[63,175,176],{"class":91},"print",[63,178,78],{"class":77},[63,180,98],{"class":97},[63,182,102],{"class":101},[63,184,98],{"class":97},[63,186,114],{"class":77},[14,188,189,190,193,194,197],{},"Here, ",[60,191,192],{},"\"Hello\""," is the argument passed to ",[60,195,196],{},"print()",".",[149,199,201],{"id":200},"argument-vs-parameter","Argument vs parameter",[14,203,204],{},"This difference is important when you start writing your own functions.",[37,206,207,214,219,229],{},[40,208,209,210,213],{},"A ",[18,211,212],{},"parameter"," is the variable named in the function definition.",[40,215,16,216,218],{},[18,217,20],{}," is the actual value passed to that function.",[40,220,221,222,225,226,228],{},"In ",[60,223,224],{},"def greet(name)",", ",[60,227,82],{}," is a parameter.",[40,230,221,231,225,234,236],{},[60,232,233],{},"greet(\"Sam\")",[60,235,143],{}," is an argument.",[14,238,239],{},"Example:",[53,241,242],{"className":55,"code":56,"language":57,"meta":58,"style":58},[60,243,244,256,274,278],{"__ignoreMap":58},[63,245,246,248,250,252,254],{"class":65,"line":66},[63,247,70],{"class":69},[63,249,74],{"class":73},[63,251,78],{"class":77},[63,253,82],{"class":81},[63,255,85],{"class":77},[63,257,258,260,262,264,266,268,270,272],{"class":65,"line":88},[63,259,92],{"class":91},[63,261,78],{"class":77},[63,263,98],{"class":97},[63,265,102],{"class":101},[63,267,98],{"class":97},[63,269,107],{"class":77},[63,271,111],{"class":110},[63,273,114],{"class":77},[63,275,276],{"class":65,"line":117},[63,277,121],{"emptyLinePlaceholder":120},[63,279,280,282,284,286,288,290],{"class":65,"line":124},[63,281,127],{"class":110},[63,283,78],{"class":77},[63,285,98],{"class":97},[63,287,134],{"class":101},[63,289,98],{"class":97},[63,291,114],{"class":77},[14,293,294],{},"What each part means:",[37,296,297,302],{},[40,298,299,301],{},[60,300,82],{}," is the parameter",[40,303,304,306],{},[60,305,143],{}," is the argument",[14,308,309,310,31,315,197],{},"If you want a fuller explanation, see ",[311,312,314],"a",{"href":313},"\u002Flearn\u002Ffunction-parameters-and-arguments-in-python\u002F","function parameters and arguments in Python",[311,316,318],{"href":317},"\u002Fglossary\u002Fwhat-is-a-parameter-in-python\u002F","what is a parameter in Python",[149,320,322],{"id":321},"why-arguments-are-useful","Why arguments are useful",[14,324,325],{},"Arguments make functions flexible.",[37,327,328,331,334],{},[40,329,330],{},"They let one function work with different values.",[40,332,333],{},"They make code more reusable.",[40,335,336],{},"They help avoid repeating similar code.",[14,338,239],{},[53,340,342],{"className":55,"code":341,"language":57,"meta":58,"style":58},"def greet(name):\n    print(\"Hello\", name)\n\ngreet(\"Sam\")\ngreet(\"Ava\")\ngreet(\"Leo\")\n",[60,343,344,356,374,378,392,408],{"__ignoreMap":58},[63,345,346,348,350,352,354],{"class":65,"line":66},[63,347,70],{"class":69},[63,349,74],{"class":73},[63,351,78],{"class":77},[63,353,82],{"class":81},[63,355,85],{"class":77},[63,357,358,360,362,364,366,368,370,372],{"class":65,"line":88},[63,359,92],{"class":91},[63,361,78],{"class":77},[63,363,98],{"class":97},[63,365,102],{"class":101},[63,367,98],{"class":97},[63,369,107],{"class":77},[63,371,111],{"class":110},[63,373,114],{"class":77},[63,375,376],{"class":65,"line":117},[63,377,121],{"emptyLinePlaceholder":120},[63,379,380,382,384,386,388,390],{"class":65,"line":124},[63,381,127],{"class":110},[63,383,78],{"class":77},[63,385,98],{"class":97},[63,387,134],{"class":101},[63,389,98],{"class":97},[63,391,114],{"class":77},[63,393,395,397,399,401,404,406],{"class":65,"line":394},5,[63,396,127],{"class":110},[63,398,78],{"class":77},[63,400,98],{"class":97},[63,402,403],{"class":101},"Ava",[63,405,98],{"class":97},[63,407,114],{"class":77},[63,409,411,413,415,417,420,422],{"class":65,"line":410},6,[63,412,127],{"class":110},[63,414,78],{"class":77},[63,416,98],{"class":97},[63,418,419],{"class":101},"Leo",[63,421,98],{"class":97},[63,423,114],{"class":77},[14,425,426],{},"Output:",[53,428,430],{"className":55,"code":429,"language":57,"meta":58,"style":58},"Hello Sam\nHello Ava\nHello Leo\n",[60,431,432,438,443],{"__ignoreMap":58},[63,433,434],{"class":65,"line":66},[63,435,437],{"class":436},"su5hD","Hello Sam\n",[63,439,440],{"class":65,"line":88},[63,441,442],{"class":436},"Hello Ava\n",[63,444,445],{"class":65,"line":117},[63,446,447],{"class":436},"Hello Leo\n",[14,449,450],{},"The function stays the same. Only the argument changes.",[149,452,454],{"id":453},"common-types-of-arguments-beginners-see","Common types of arguments beginners see",[456,457,459],"h3",{"id":458},"positional-arguments","Positional arguments",[14,461,209,462,465],{},[18,463,464],{},"positional argument"," is matched by order.",[53,467,469],{"className":55,"code":468,"language":57,"meta":58,"style":58},"def add(a, b):\n    print(a + b)\n\nadd(3, 5)\n",[60,470,471,489,506,510],{"__ignoreMap":58},[63,472,473,475,478,480,482,484,487],{"class":65,"line":66},[63,474,70],{"class":69},[63,476,477],{"class":73}," add",[63,479,78],{"class":77},[63,481,311],{"class":81},[63,483,107],{"class":77},[63,485,486],{"class":81}," b",[63,488,85],{"class":77},[63,490,491,493,495,498,502,504],{"class":65,"line":88},[63,492,92],{"class":91},[63,494,78],{"class":77},[63,496,497],{"class":110},"a ",[63,499,501],{"class":500},"smGrS","+",[63,503,486],{"class":110},[63,505,114],{"class":77},[63,507,508],{"class":65,"line":117},[63,509,121],{"emptyLinePlaceholder":120},[63,511,512,515,517,521,523,526],{"class":65,"line":124},[63,513,514],{"class":110},"add",[63,516,78],{"class":77},[63,518,520],{"class":519},"srdBf","3",[63,522,107],{"class":77},[63,524,525],{"class":519}," 5",[63,527,114],{"class":77},[14,529,426],{},[53,531,533],{"className":55,"code":532,"language":57,"meta":58,"style":58},"8\n",[60,534,535],{"__ignoreMap":58},[63,536,537],{"class":65,"line":66},[63,538,532],{"class":519},[14,540,541],{},"Here:",[37,543,544,551],{},[40,545,546,548,549],{},[60,547,520],{}," is passed to ",[60,550,311],{},[40,552,553,548,556],{},[60,554,555],{},"5",[60,557,558],{},"b",[14,560,561],{},"If you swap the order, the values go into different parameters.",[456,563,565],{"id":564},"keyword-arguments","Keyword arguments",[14,567,209,568,571],{},[18,569,570],{},"keyword argument"," is matched by parameter name.",[53,573,575],{"className":55,"code":574,"language":57,"meta":58,"style":58},"def greet(name, message):\n    print(message, name)\n\ngreet(name=\"Sam\", message=\"Hello\")\n",[60,576,577,594,609,613],{"__ignoreMap":58},[63,578,579,581,583,585,587,589,592],{"class":65,"line":66},[63,580,70],{"class":69},[63,582,74],{"class":73},[63,584,78],{"class":77},[63,586,82],{"class":81},[63,588,107],{"class":77},[63,590,591],{"class":81}," message",[63,593,85],{"class":77},[63,595,596,598,600,603,605,607],{"class":65,"line":88},[63,597,92],{"class":91},[63,599,78],{"class":77},[63,601,602],{"class":110},"message",[63,604,107],{"class":77},[63,606,111],{"class":110},[63,608,114],{"class":77},[63,610,611],{"class":65,"line":117},[63,612,121],{"emptyLinePlaceholder":120},[63,614,615,617,619,622,625,627,629,631,633,635,637,639,641,643],{"class":65,"line":124},[63,616,127],{"class":110},[63,618,78],{"class":77},[63,620,82],{"class":621},"s99_P",[63,623,624],{"class":500},"=",[63,626,98],{"class":97},[63,628,134],{"class":101},[63,630,98],{"class":97},[63,632,107],{"class":77},[63,634,591],{"class":621},[63,636,624],{"class":500},[63,638,98],{"class":97},[63,640,102],{"class":101},[63,642,98],{"class":97},[63,644,114],{"class":77},[14,646,426],{},[53,648,649],{"className":55,"code":437,"language":57,"meta":58,"style":58},[60,650,651],{"__ignoreMap":58},[63,652,653],{"class":65,"line":66},[63,654,437],{"class":436},[14,656,657,658,197],{},"Keyword arguments can make code easier to read. Learn more in ",[311,659,661],{"href":660},"\u002Flearn\u002Fdefault-and-keyword-arguments-explained\u002F","default and keyword arguments explained",[456,663,665],{"id":664},"default-arguments","Default arguments",[14,667,668],{},"A parameter can have a default value. If you do not pass an argument for it, Python uses the default.",[53,670,672],{"className":55,"code":671,"language":57,"meta":58,"style":58},"def greet(name=\"friend\"):\n    print(\"Hello\", name)\n\ngreet()\ngreet(\"Sam\")\n",[60,673,674,695,713,717,724],{"__ignoreMap":58},[63,675,676,678,680,682,684,686,688,691,693],{"class":65,"line":66},[63,677,70],{"class":69},[63,679,74],{"class":73},[63,681,78],{"class":77},[63,683,82],{"class":81},[63,685,624],{"class":500},[63,687,98],{"class":97},[63,689,690],{"class":101},"friend",[63,692,98],{"class":97},[63,694,85],{"class":77},[63,696,697,699,701,703,705,707,709,711],{"class":65,"line":88},[63,698,92],{"class":91},[63,700,78],{"class":77},[63,702,98],{"class":97},[63,704,102],{"class":101},[63,706,98],{"class":97},[63,708,107],{"class":77},[63,710,111],{"class":110},[63,712,114],{"class":77},[63,714,715],{"class":65,"line":117},[63,716,121],{"emptyLinePlaceholder":120},[63,718,719,721],{"class":65,"line":124},[63,720,127],{"class":110},[63,722,723],{"class":77},"()\n",[63,725,726,728,730,732,734,736],{"class":65,"line":394},[63,727,127],{"class":110},[63,729,78],{"class":77},[63,731,98],{"class":97},[63,733,134],{"class":101},[63,735,98],{"class":97},[63,737,114],{"class":77},[14,739,426],{},[53,741,743],{"className":55,"code":742,"language":57,"meta":58,"style":58},"Hello friend\nHello Sam\n",[60,744,745,750],{"__ignoreMap":58},[63,746,747],{"class":65,"line":66},[63,748,749],{"class":436},"Hello friend\n",[63,751,752],{"class":65,"line":88},[63,753,437],{"class":436},[149,755,757],{"id":756},"how-to-read-a-function-call","How to read a function call",[14,759,760],{},"When you see a function call, read it in this order:",[37,762,763,766,769,772],{},[40,764,765],{},"Look at the function name first.",[40,767,768],{},"Then look inside the parentheses.",[40,770,771],{},"The values inside are the arguments.",[40,773,774],{},"A function can have zero, one, or many arguments.",[14,776,777],{},"Examples:",[53,779,781],{"className":55,"code":780,"language":57,"meta":58,"style":58},"print(\"Hi\")\nlen(\"apple\")\nsum([1, 2, 3])\n",[60,782,783,798,814],{"__ignoreMap":58},[63,784,785,787,789,791,794,796],{"class":65,"line":66},[63,786,176],{"class":91},[63,788,78],{"class":77},[63,790,98],{"class":97},[63,792,793],{"class":101},"Hi",[63,795,98],{"class":97},[63,797,114],{"class":77},[63,799,800,803,805,807,810,812],{"class":65,"line":88},[63,801,802],{"class":91},"len",[63,804,78],{"class":77},[63,806,98],{"class":97},[63,808,809],{"class":101},"apple",[63,811,98],{"class":97},[63,813,114],{"class":77},[63,815,816,819,822,825,827,830,832,835],{"class":65,"line":117},[63,817,818],{"class":91},"sum",[63,820,821],{"class":77},"([",[63,823,824],{"class":519},"1",[63,826,107],{"class":77},[63,828,829],{"class":519}," 2",[63,831,107],{"class":77},[63,833,834],{"class":519}," 3",[63,836,837],{"class":77},"])\n",[14,839,840],{},"In these calls:",[37,842,843,851,859],{},[40,844,845,848,849],{},[60,846,847],{},"\"Hi\""," is an argument to ",[60,850,196],{},[40,852,853,848,856],{},[60,854,855],{},"\"apple\"",[60,857,858],{},"len()",[40,860,861,848,864],{},[60,862,863],{},"[1, 2, 3]",[60,865,866],{},"sum()",[14,868,869,870,197],{},"If you are new to functions, it also helps to read ",[311,871,873],{"href":872},"\u002Fglossary\u002Fwhat-is-a-function-in-python\u002F","what is a function in Python",[149,875,877],{"id":876},"beginner-examples-to-include","Beginner examples to include",[456,879,881],{"id":880},"one-argument-passed-to-a-print-like-function","One argument passed to a print-like function",[53,883,885],{"className":55,"code":884,"language":57,"meta":58,"style":58},"print(\"Python is fun\")\n",[60,886,887],{"__ignoreMap":58},[63,888,889,891,893,895,898,900],{"class":65,"line":66},[63,890,176],{"class":91},[63,892,78],{"class":77},[63,894,98],{"class":97},[63,896,897],{"class":101},"Python is fun",[63,899,98],{"class":97},[63,901,114],{"class":77},[14,903,904,907],{},[60,905,906],{},"\"Python is fun\""," is the argument.",[456,909,911],{"id":910},"two-arguments-passed-to-an-add-function","Two arguments passed to an add function",[53,913,915],{"className":55,"code":914,"language":57,"meta":58,"style":58},"def add(a, b):\n    print(a + b)\n\nadd(10, 20)\n",[60,916,917,933,947,951],{"__ignoreMap":58},[63,918,919,921,923,925,927,929,931],{"class":65,"line":66},[63,920,70],{"class":69},[63,922,477],{"class":73},[63,924,78],{"class":77},[63,926,311],{"class":81},[63,928,107],{"class":77},[63,930,486],{"class":81},[63,932,85],{"class":77},[63,934,935,937,939,941,943,945],{"class":65,"line":88},[63,936,92],{"class":91},[63,938,78],{"class":77},[63,940,497],{"class":110},[63,942,501],{"class":500},[63,944,486],{"class":110},[63,946,114],{"class":77},[63,948,949],{"class":65,"line":117},[63,950,121],{"emptyLinePlaceholder":120},[63,952,953,955,957,960,962,965],{"class":65,"line":124},[63,954,514],{"class":110},[63,956,78],{"class":77},[63,958,959],{"class":519},"10",[63,961,107],{"class":77},[63,963,964],{"class":519}," 20",[63,966,114],{"class":77},[14,968,426],{},[53,970,972],{"className":55,"code":971,"language":57,"meta":58,"style":58},"30\n",[60,973,974],{"__ignoreMap":58},[63,975,976],{"class":65,"line":66},[63,977,971],{"class":519},[14,979,980,31,982,985],{},[60,981,959],{},[60,983,984],{},"20"," are the arguments.",[456,987,989],{"id":988},"keyword-argument-example","Keyword argument example",[53,991,993],{"className":55,"code":992,"language":57,"meta":58,"style":58},"def show_user(name, age):\n    print(name, age)\n\nshow_user(age=25, name=\"Maya\")\n",[60,994,995,1013,1027,1031],{"__ignoreMap":58},[63,996,997,999,1002,1004,1006,1008,1011],{"class":65,"line":66},[63,998,70],{"class":69},[63,1000,1001],{"class":73}," show_user",[63,1003,78],{"class":77},[63,1005,82],{"class":81},[63,1007,107],{"class":77},[63,1009,1010],{"class":81}," age",[63,1012,85],{"class":77},[63,1014,1015,1017,1019,1021,1023,1025],{"class":65,"line":88},[63,1016,92],{"class":91},[63,1018,78],{"class":77},[63,1020,82],{"class":110},[63,1022,107],{"class":77},[63,1024,1010],{"class":110},[63,1026,114],{"class":77},[63,1028,1029],{"class":65,"line":117},[63,1030,121],{"emptyLinePlaceholder":120},[63,1032,1033,1036,1038,1041,1043,1046,1048,1050,1052,1054,1057,1059],{"class":65,"line":124},[63,1034,1035],{"class":110},"show_user",[63,1037,78],{"class":77},[63,1039,1040],{"class":621},"age",[63,1042,624],{"class":500},[63,1044,1045],{"class":519},"25",[63,1047,107],{"class":77},[63,1049,111],{"class":621},[63,1051,624],{"class":500},[63,1053,98],{"class":97},[63,1055,1056],{"class":101},"Maya",[63,1058,98],{"class":97},[63,1060,114],{"class":77},[14,1062,426],{},[53,1064,1066],{"className":55,"code":1065,"language":57,"meta":58,"style":58},"Maya 25\n",[60,1067,1068],{"__ignoreMap":58},[63,1069,1070,1073],{"class":65,"line":66},[63,1071,1072],{"class":436},"Maya ",[63,1074,1075],{"class":519},"25\n",[14,1077,1078],{},"The arguments are still values, but they are passed by parameter name.",[456,1080,1082],{"id":1081},"function-call-with-no-arguments","Function call with no arguments",[53,1084,1086],{"className":55,"code":1085,"language":57,"meta":58,"style":58},"def say_hello():\n    print(\"Hello\")\n\nsay_hello()\n",[60,1087,1088,1098,1112,1116],{"__ignoreMap":58},[63,1089,1090,1092,1095],{"class":65,"line":66},[63,1091,70],{"class":69},[63,1093,1094],{"class":73}," say_hello",[63,1096,1097],{"class":77},"():\n",[63,1099,1100,1102,1104,1106,1108,1110],{"class":65,"line":88},[63,1101,92],{"class":91},[63,1103,78],{"class":77},[63,1105,98],{"class":97},[63,1107,102],{"class":101},[63,1109,98],{"class":97},[63,1111,114],{"class":77},[63,1113,1114],{"class":65,"line":117},[63,1115,121],{"emptyLinePlaceholder":120},[63,1117,1118,1121],{"class":65,"line":124},[63,1119,1120],{"class":110},"say_hello",[63,1122,723],{"class":77},[14,1124,1125],{},"This function call has no arguments because nothing is inside the parentheses.",[149,1127,1129],{"id":1128},"common-mistakes","Common mistakes",[14,1131,1132],{},"Beginners often run into these problems:",[37,1134,1135,1138,1143,1146,1149],{},[40,1136,1137],{},"Mixing up arguments and parameters",[40,1139,1140,1141,306],{},"Thinking the variable in ",[60,1142,70],{},[40,1144,1145],{},"Passing arguments in the wrong order",[40,1147,1148],{},"Forgetting required arguments when calling a function",[40,1150,1151],{},"Using a keyword name that does not exist in the function definition",[14,1153,1154],{},"Example of a missing argument:",[53,1156,1158],{"className":55,"code":1157,"language":57,"meta":58,"style":58},"def greet(name):\n    print(\"Hello\", name)\n\ngreet()\n",[60,1159,1160,1172,1190,1194],{"__ignoreMap":58},[63,1161,1162,1164,1166,1168,1170],{"class":65,"line":66},[63,1163,70],{"class":69},[63,1165,74],{"class":73},[63,1167,78],{"class":77},[63,1169,82],{"class":81},[63,1171,85],{"class":77},[63,1173,1174,1176,1178,1180,1182,1184,1186,1188],{"class":65,"line":88},[63,1175,92],{"class":91},[63,1177,78],{"class":77},[63,1179,98],{"class":97},[63,1181,102],{"class":101},[63,1183,98],{"class":97},[63,1185,107],{"class":77},[63,1187,111],{"class":110},[63,1189,114],{"class":77},[63,1191,1192],{"class":65,"line":117},[63,1193,121],{"emptyLinePlaceholder":120},[63,1195,1196,1198],{"class":65,"line":124},[63,1197,127],{"class":110},[63,1199,723],{"class":77},[14,1201,1202,1203,1205],{},"This causes an error because ",[60,1204,82],{}," needs a value.",[14,1207,1208,1209,197],{},"If you see this problem, read ",[311,1210,1212,1213],{"href":1211},"\u002Ferrors\u002Ftypeerror-missing-required-positional-argument-fix\u002F","how to fix ",[60,1214,1215],{},"TypeError: missing required positional argument",[14,1217,1218],{},"Useful checks while learning:",[53,1220,1222],{"className":55,"code":1221,"language":57,"meta":58,"style":58},"help(print)\nhelp(len)\nprint(type(\"Sam\"))\nprint(len.__defaults__)\n",[60,1223,1224,1235,1245,1266],{"__ignoreMap":58},[63,1225,1226,1229,1231,1233],{"class":65,"line":66},[63,1227,1228],{"class":91},"help",[63,1230,78],{"class":77},[63,1232,176],{"class":91},[63,1234,114],{"class":77},[63,1236,1237,1239,1241,1243],{"class":65,"line":88},[63,1238,1228],{"class":91},[63,1240,78],{"class":77},[63,1242,802],{"class":91},[63,1244,114],{"class":77},[63,1246,1247,1249,1251,1255,1257,1259,1261,1263],{"class":65,"line":117},[63,1248,176],{"class":91},[63,1250,78],{"class":77},[63,1252,1254],{"class":1253},"sZMiF","type",[63,1256,78],{"class":77},[63,1258,98],{"class":97},[63,1260,134],{"class":101},[63,1262,98],{"class":97},[63,1264,1265],{"class":77},"))\n",[63,1267,1268,1270,1272,1274,1276,1280],{"class":65,"line":124},[63,1269,176],{"class":91},[63,1271,78],{"class":77},[63,1273,802],{"class":91},[63,1275,197],{"class":77},[63,1277,1279],{"class":1278},"s_hVV","__defaults__",[63,1281,114],{"class":77},[14,1283,1284],{},"These can help you inspect built-in functions and understand what kind of values you are passing.",[149,1286,1288],{"id":1287},"faq","FAQ",[456,1290,1292],{"id":1291},"what-is-the-difference-between-an-argument-and-a-parameter-in-python","What is the difference between an argument and a parameter in Python?",[14,1294,1295],{},"A parameter is the name in the function definition. An argument is the value passed when calling the function.",[456,1297,1299],{"id":1298},"can-a-function-have-more-than-one-argument","Can a function have more than one argument?",[14,1301,1302],{},"Yes. A function can accept multiple arguments if it is defined with multiple parameters.",[456,1304,1306],{"id":1305},"can-a-function-have-no-arguments","Can a function have no arguments?",[14,1308,1309],{},"Yes. Some functions are called with empty parentheses.",[456,1311,1313],{"id":1312},"are-keyword-arguments-and-positional-arguments-both-arguments","Are keyword arguments and positional arguments both arguments?",[14,1315,1316],{},"Yes. They are two common ways to pass values to a function.",[149,1318,1320],{"id":1319},"see-also","See also",[37,1322,1323,1328,1333,1338,1343],{},[40,1324,1325],{},[311,1326,1327],{"href":313},"Function parameters and arguments in Python",[40,1329,1330],{},[311,1331,1332],{"href":317},"What is a parameter in Python?",[40,1334,1335],{},[311,1336,1337],{"href":872},"What is a function in Python?",[40,1339,1340],{},[311,1341,1342],{"href":660},"Default and keyword arguments explained",[40,1344,1345],{},[311,1346,1347,1348],{"href":1211},"How to fix ",[60,1349,1215],{},[14,1351,1352],{},"Next, learn how parameters and arguments work together in real function examples.",[1354,1355,1356],"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 .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 .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 .srdBf, html code.shiki .srdBf{--shiki-light:#F76D47;--shiki-default:#005CC5;--shiki-dark:#79B8FF}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 .sZMiF, html code.shiki .sZMiF{--shiki-light:#E2931D;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .s_hVV, html code.shiki .s_hVV{--shiki-light:#90A4AE;--shiki-default:#005CC5;--shiki-dark:#79B8FF}",{"title":58,"searchDepth":88,"depth":88,"links":1358},[1359,1360,1361,1362,1367,1368,1374,1375,1381],{"id":151,"depth":88,"text":152},{"id":200,"depth":88,"text":201},{"id":321,"depth":88,"text":322},{"id":453,"depth":88,"text":454,"children":1363},[1364,1365,1366],{"id":458,"depth":117,"text":459},{"id":564,"depth":117,"text":565},{"id":664,"depth":117,"text":665},{"id":756,"depth":88,"text":757},{"id":876,"depth":88,"text":877,"children":1369},[1370,1371,1372,1373],{"id":880,"depth":117,"text":881},{"id":910,"depth":117,"text":911},{"id":988,"depth":117,"text":989},{"id":1081,"depth":117,"text":1082},{"id":1128,"depth":88,"text":1129},{"id":1287,"depth":88,"text":1288,"children":1376},[1377,1378,1379,1380],{"id":1291,"depth":117,"text":1292},{"id":1298,"depth":117,"text":1299},{"id":1305,"depth":117,"text":1306},{"id":1312,"depth":117,"text":1313},{"id":1319,"depth":88,"text":1320},"Master what is an argument in python in our comprehensive Python beginner guide.","md",{},"\u002Fglossary\u002Fwhat-is-an-argument-in-python",{"title":5,"description":1382},"glossary\u002Fwhat-is-an-argument-in-python","-8aV3VDQG4YbaW1kznCmTUHo2kl-lKbjK0HX9sT8itk",1777585496591]