[{"data":1,"prerenderedAt":1164},["ShallowReactive",2],{"doc-\u002Ferrors\u002Fnameerror-global-name-not-defined-fix":3},{"id":4,"title":5,"body":6,"description":1157,"extension":1158,"meta":1159,"navigation":348,"path":1160,"seo":1161,"stem":1162,"__hash__":1163},"content\u002Ferrors\u002Fnameerror-global-name-not-defined-fix.md","NameError: global name not defined (Fix)",{"type":7,"value":8,"toc":1134},"minimark",[9,13,22,27,79,86,90,93,99,115,118,150,157,161,164,181,190,194,199,204,231,234,259,269,273,300,302,327,330,369,371,380,387,391,421,423,448,457,461,464,481,484,507,510,558,561,589,593,599,610,614,668,670,694,697,713,716,774,776,785,795,799,802,820,823,862,865,921,935,938,953,960,964,967,987,990,1015,1018,1043,1052,1056,1060,1066,1070,1075,1079,1082,1086,1096,1100,1130],[10,11,5],"h1",{"id":12},"nameerror-global-name-not-defined-fix",[14,15,16,17,21],"p",{},"Fix the Python error ",[18,19,20],"strong",{},"\"NameError: global name not defined\""," by finding the missing or misspelled name and making sure it exists before you use it.",[23,24,26],"h2",{"id":25},"quick-fix","Quick fix",[28,29,34],"pre",{"className":30,"code":31,"language":32,"meta":33,"style":33},"language-python shiki shiki-themes material-theme-lighter github-light github-dark","message = \"Hello\"\nprint(message)\n","python","",[35,36,37,61],"code",{"__ignoreMap":33},[38,39,42,46,50,54,58],"span",{"class":40,"line":41},"line",1,[38,43,45],{"class":44},"su5hD","message ",[38,47,49],{"class":48},"smGrS","=",[38,51,53],{"class":52},"sjJ54"," \"",[38,55,57],{"class":56},"s_sjI","Hello",[38,59,60],{"class":52},"\"\n",[38,62,64,68,72,76],{"class":40,"line":63},2,[38,65,67],{"class":66},"sptTA","print",[38,69,71],{"class":70},"sP7_E","(",[38,73,75],{"class":74},"slqww","message",[38,77,78],{"class":70},")\n",[14,80,81,82,85],{},"A ",[35,83,84],{},"NameError"," happens when Python cannot find a variable, function, or module name. Define it first, spell it correctly, and use the right scope.",[23,87,89],{"id":88},"what-this-error-means","What this error means",[14,91,92],{},"Python raises this error when it tries to use a name that does not exist in the current scope.",[14,94,81,95,98],{},[18,96,97],{},"name"," can be:",[100,101,102,106,109,112],"ul",{},[103,104,105],"li",{},"A variable",[103,107,108],{},"A function",[103,110,111],{},"A class",[103,113,114],{},"An imported module",[14,116,117],{},"You will often see this in modern Python 3 as:",[28,119,121],{"className":30,"code":120,"language":32,"meta":33,"style":33},"NameError: name 'message' is not defined\n",[35,122,123],{"__ignoreMap":33},[38,124,125,128,131,134,137,139,141,144,147],{"class":40,"line":41},[38,126,84],{"class":127},"sZMiF",[38,129,130],{"class":70},":",[38,132,133],{"class":44}," name ",[38,135,136],{"class":52},"'",[38,138,75],{"class":56},[38,140,136],{"class":52},[38,142,143],{"class":48}," is",[38,145,146],{"class":48}," not",[38,148,149],{"class":44}," defined\n",[14,151,152,153,156],{},"Older Python 2 wording sometimes says ",[18,154,155],{},"\"global name not defined\"",". The meaning is the same.",[23,158,160],{"id":159},"why-it-happens","Why it happens",[14,162,163],{},"This error usually happens for one of these reasons:",[100,165,166,169,172,175,178],{},[103,167,168],{},"You used a variable before assigning a value to it",[103,170,171],{},"You misspelled the name",[103,173,174],{},"You used a name outside the function or block where it was created",[103,176,177],{},"You forgot to import a module or function",[103,179,180],{},"You expected a global variable to exist, but it was never defined",[14,182,183,184,189],{},"If you are new to variables, see ",[185,186,188],"a",{"href":187},"\u002Flearn\u002Fpython-variables-explained-for-beginners","Python variables explained for beginners",".",[23,191,193],{"id":192},"example-that-causes-the-error","Example that causes the error",[14,195,196,197,189],{},"Here are common examples that trigger ",[35,198,84],{},[200,201,203],"h3",{"id":202},"using-a-variable-before-assigning-it","Using a variable before assigning it",[28,205,207],{"className":30,"code":206,"language":32,"meta":33,"style":33},"print(total)\ntotal = 10\n",[35,208,209,220],{"__ignoreMap":33},[38,210,211,213,215,218],{"class":40,"line":41},[38,212,67],{"class":66},[38,214,71],{"class":70},[38,216,217],{"class":74},"total",[38,219,78],{"class":70},[38,221,222,225,227],{"class":40,"line":63},[38,223,224],{"class":44},"total ",[38,226,49],{"class":48},[38,228,230],{"class":229},"srdBf"," 10\n",[14,232,233],{},"Output:",[28,235,237],{"className":30,"code":236,"language":32,"meta":33,"style":33},"NameError: name 'total' is not defined\n",[35,238,239],{"__ignoreMap":33},[38,240,241,243,245,247,249,251,253,255,257],{"class":40,"line":41},[38,242,84],{"class":127},[38,244,130],{"class":70},[38,246,133],{"class":44},[38,248,136],{"class":52},[38,250,217],{"class":56},[38,252,136],{"class":52},[38,254,143],{"class":48},[38,256,146],{"class":48},[38,258,149],{"class":44},[14,260,261,262,265,266,268],{},"Python reads code from top to bottom. At the moment ",[35,263,264],{},"print(total)"," runs, ",[35,267,217],{}," does not exist yet.",[200,270,272],{"id":271},"forgetting-to-import-a-module","Forgetting to import a module",[28,274,276],{"className":30,"code":275,"language":32,"meta":33,"style":33},"print(math.sqrt(4))\n",[35,277,278],{"__ignoreMap":33},[38,279,280,282,284,287,289,292,294,297],{"class":40,"line":41},[38,281,67],{"class":66},[38,283,71],{"class":70},[38,285,286],{"class":74},"math",[38,288,189],{"class":70},[38,290,291],{"class":74},"sqrt",[38,293,71],{"class":70},[38,295,296],{"class":229},"4",[38,298,299],{"class":70},"))\n",[14,301,233],{},[28,303,305],{"className":30,"code":304,"language":32,"meta":33,"style":33},"NameError: name 'math' is not defined\n",[35,306,307],{"__ignoreMap":33},[38,308,309,311,313,315,317,319,321,323,325],{"class":40,"line":41},[38,310,84],{"class":127},[38,312,130],{"class":70},[38,314,133],{"class":44},[38,316,136],{"class":52},[38,318,286],{"class":56},[38,320,136],{"class":52},[38,322,143],{"class":48},[38,324,146],{"class":48},[38,326,149],{"class":44},[14,328,329],{},"Fix:",[28,331,333],{"className":30,"code":332,"language":32,"meta":33,"style":33},"import math\n\nprint(math.sqrt(4))\n",[35,334,335,344,350],{"__ignoreMap":33},[38,336,337,341],{"class":40,"line":41},[38,338,340],{"class":339},"sVHd0","import",[38,342,343],{"class":44}," math\n",[38,345,346],{"class":40,"line":63},[38,347,349],{"emptyLinePlaceholder":348},true,"\n",[38,351,353,355,357,359,361,363,365,367],{"class":40,"line":352},3,[38,354,67],{"class":66},[38,356,71],{"class":70},[38,358,286],{"class":74},[38,360,189],{"class":70},[38,362,291],{"class":74},[38,364,71],{"class":70},[38,366,296],{"class":229},[38,368,299],{"class":70},[14,370,233],{},[28,372,374],{"className":30,"code":373,"language":32,"meta":33,"style":33},"2.0\n",[35,375,376],{"__ignoreMap":33},[38,377,378],{"class":40,"line":41},[38,379,373],{"class":229},[14,381,382,383,189],{},"If imports are confusing, read ",[185,384,386],{"href":385},"\u002Flearn\u002Fpython-modules-explained","Python modules explained",[200,388,390],{"id":389},"using-the-wrong-variable-name","Using the wrong variable name",[28,392,394],{"className":30,"code":393,"language":32,"meta":33,"style":33},"user_name = \"Maya\"\nprint(username)\n",[35,395,396,410],{"__ignoreMap":33},[38,397,398,401,403,405,408],{"class":40,"line":41},[38,399,400],{"class":44},"user_name ",[38,402,49],{"class":48},[38,404,53],{"class":52},[38,406,407],{"class":56},"Maya",[38,409,60],{"class":52},[38,411,412,414,416,419],{"class":40,"line":63},[38,413,67],{"class":66},[38,415,71],{"class":70},[38,417,418],{"class":74},"username",[38,420,78],{"class":70},[14,422,233],{},[28,424,426],{"className":30,"code":425,"language":32,"meta":33,"style":33},"NameError: name 'username' is not defined\n",[35,427,428],{"__ignoreMap":33},[38,429,430,432,434,436,438,440,442,444,446],{"class":40,"line":41},[38,431,84],{"class":127},[38,433,130],{"class":70},[38,435,133],{"class":44},[38,437,136],{"class":52},[38,439,418],{"class":56},[38,441,136],{"class":52},[38,443,143],{"class":48},[38,445,146],{"class":48},[38,447,149],{"class":44},[14,449,450,451,454,455,189],{},"The variable is named ",[35,452,453],{},"user_name",", not ",[35,456,418],{},[23,458,460],{"id":459},"how-to-fix-it","How to fix it",[14,462,463],{},"Use these steps to fix the error:",[100,465,466,469,472,475,478],{},[103,467,468],{},"Define the variable before you use it",[103,470,471],{},"Check spelling and letter case carefully",[103,473,474],{},"Make sure the name exists in the right scope",[103,476,477],{},"Import the module or function before calling it",[103,479,480],{},"Read the traceback line number to find where the missing name is used",[14,482,483],{},"Example of fixing the order:",[28,485,487],{"className":30,"code":486,"language":32,"meta":33,"style":33},"total = 10\nprint(total)\n",[35,488,489,497],{"__ignoreMap":33},[38,490,491,493,495],{"class":40,"line":41},[38,492,224],{"class":44},[38,494,49],{"class":48},[38,496,230],{"class":229},[38,498,499,501,503,505],{"class":40,"line":63},[38,500,67],{"class":66},[38,502,71],{"class":70},[38,504,217],{"class":74},[38,506,78],{"class":70},[14,508,509],{},"Example of fixing an import:",[28,511,513],{"className":30,"code":512,"language":32,"meta":33,"style":33},"import math\n\nresult = math.sqrt(9)\nprint(result)\n",[35,514,515,521,525,546],{"__ignoreMap":33},[38,516,517,519],{"class":40,"line":41},[38,518,340],{"class":339},[38,520,343],{"class":44},[38,522,523],{"class":40,"line":63},[38,524,349],{"emptyLinePlaceholder":348},[38,526,527,530,532,535,537,539,541,544],{"class":40,"line":352},[38,528,529],{"class":44},"result ",[38,531,49],{"class":48},[38,533,534],{"class":44}," math",[38,536,189],{"class":70},[38,538,291],{"class":74},[38,540,71],{"class":70},[38,542,543],{"class":229},"9",[38,545,78],{"class":70},[38,547,549,551,553,556],{"class":40,"line":548},4,[38,550,67],{"class":66},[38,552,71],{"class":70},[38,554,555],{"class":74},"result",[38,557,78],{"class":70},[14,559,560],{},"Example of fixing a typo:",[28,562,564],{"className":30,"code":563,"language":32,"meta":33,"style":33},"username = \"Maya\"\nprint(username)\n",[35,565,566,579],{"__ignoreMap":33},[38,567,568,571,573,575,577],{"class":40,"line":41},[38,569,570],{"class":44},"username ",[38,572,49],{"class":48},[38,574,53],{"class":52},[38,576,407],{"class":56},[38,578,60],{"class":52},[38,580,581,583,585,587],{"class":40,"line":63},[38,582,67],{"class":66},[38,584,71],{"class":70},[38,586,418],{"class":74},[38,588,78],{"class":70},[23,590,592],{"id":591},"check-scope-problems","Check scope problems",[14,594,595,596,189],{},"Scope means ",[18,597,598],{},"where a name is available in your program",[100,600,601,604,607],{},[103,602,603],{},"A variable created inside a function usually cannot be used outside that function",[103,605,606],{},"A variable created outside a function can usually be read inside the function",[103,608,609],{},"If you assign to a name inside a function, Python treats it as local unless handled differently",[200,611,613],{"id":612},"local-variable-used-outside-a-function","Local variable used outside a function",[28,615,617],{"className":30,"code":616,"language":32,"meta":33,"style":33},"def greet():\n    message = \"Hello\"\n\ngreet()\nprint(message)\n",[35,618,619,632,645,649,657],{"__ignoreMap":33},[38,620,621,625,629],{"class":40,"line":41},[38,622,624],{"class":623},"sbsja","def",[38,626,628],{"class":627},"sGLFI"," greet",[38,630,631],{"class":70},"():\n",[38,633,634,637,639,641,643],{"class":40,"line":63},[38,635,636],{"class":44},"    message ",[38,638,49],{"class":48},[38,640,53],{"class":52},[38,642,57],{"class":56},[38,644,60],{"class":52},[38,646,647],{"class":40,"line":352},[38,648,349],{"emptyLinePlaceholder":348},[38,650,651,654],{"class":40,"line":548},[38,652,653],{"class":74},"greet",[38,655,656],{"class":70},"()\n",[38,658,660,662,664,666],{"class":40,"line":659},5,[38,661,67],{"class":66},[38,663,71],{"class":70},[38,665,75],{"class":74},[38,667,78],{"class":70},[14,669,233],{},[28,671,672],{"className":30,"code":120,"language":32,"meta":33,"style":33},[35,673,674],{"__ignoreMap":33},[38,675,676,678,680,682,684,686,688,690,692],{"class":40,"line":41},[38,677,84],{"class":127},[38,679,130],{"class":70},[38,681,133],{"class":44},[38,683,136],{"class":52},[38,685,75],{"class":56},[38,687,136],{"class":52},[38,689,143],{"class":48},[38,691,146],{"class":48},[38,693,149],{"class":44},[14,695,696],{},"Why this happens:",[100,698,699,707,710],{},[103,700,701,703,704],{},[35,702,75],{}," was created inside ",[35,705,706],{},"greet()",[103,708,709],{},"It only exists while that function runs",[103,711,712],{},"Outside the function, Python cannot find it",[14,714,715],{},"Fix it by returning the value:",[28,717,719],{"className":30,"code":718,"language":32,"meta":33,"style":33},"def greet():\n    message = \"Hello\"\n    return message\n\nmessage = greet()\nprint(message)\n",[35,720,721,729,741,749,753,763],{"__ignoreMap":33},[38,722,723,725,727],{"class":40,"line":41},[38,724,624],{"class":623},[38,726,628],{"class":627},[38,728,631],{"class":70},[38,730,731,733,735,737,739],{"class":40,"line":63},[38,732,636],{"class":44},[38,734,49],{"class":48},[38,736,53],{"class":52},[38,738,57],{"class":56},[38,740,60],{"class":52},[38,742,743,746],{"class":40,"line":352},[38,744,745],{"class":339},"    return",[38,747,748],{"class":44}," message\n",[38,750,751],{"class":40,"line":548},[38,752,349],{"emptyLinePlaceholder":348},[38,754,755,757,759,761],{"class":40,"line":659},[38,756,45],{"class":44},[38,758,49],{"class":48},[38,760,628],{"class":74},[38,762,656],{"class":70},[38,764,766,768,770,772],{"class":40,"line":765},6,[38,767,67],{"class":66},[38,769,71],{"class":70},[38,771,75],{"class":74},[38,773,78],{"class":70},[14,775,233],{},[28,777,779],{"className":30,"code":778,"language":32,"meta":33,"style":33},"Hello\n",[35,780,781],{"__ignoreMap":33},[38,782,783],{"class":40,"line":41},[38,784,778],{"class":44},[14,786,787,788,790,791,189],{},"If you want a fuller explanation, see ",[185,789,188],{"href":187}," and ",[185,792,794],{"href":793},"\u002Ferrors\u002Funboundlocalerror-local-variable-referenced-before-assignment-fix","UnboundLocalError: local variable referenced before assignment",[23,796,798],{"id":797},"debugging-steps","Debugging steps",[14,800,801],{},"When you see this error, work through these steps:",[803,804,805,808,811,814,817],"ol",{},[103,806,807],{},"Read the exact missing name in the error message",[103,809,810],{},"Go to the line shown in the traceback",[103,812,813],{},"Search earlier in the file for where that name should be defined",[103,815,816],{},"Check for typos, missing imports, and wrong indentation",[103,818,819],{},"Print nearby values if needed to confirm your program flow",[14,821,822],{},"Useful debugging commands:",[28,824,826],{"className":30,"code":825,"language":32,"meta":33,"style":33},"print(variable_name)\nprint(locals())\nprint(globals())\n",[35,827,828,839,851],{"__ignoreMap":33},[38,829,830,832,834,837],{"class":40,"line":41},[38,831,67],{"class":66},[38,833,71],{"class":70},[38,835,836],{"class":74},"variable_name",[38,838,78],{"class":70},[38,840,841,843,845,848],{"class":40,"line":63},[38,842,67],{"class":66},[38,844,71],{"class":70},[38,846,847],{"class":66},"locals",[38,849,850],{"class":70},"())\n",[38,852,853,855,857,860],{"class":40,"line":352},[38,854,67],{"class":66},[38,856,71],{"class":70},[38,858,859],{"class":66},"globals",[38,861,850],{"class":70},[14,863,864],{},"For example, if you think a variable should exist inside a function:",[28,866,868],{"className":30,"code":867,"language":32,"meta":33,"style":33},"def test():\n    value = 5\n    print(locals())\n\ntest()\nprint(globals())\n",[35,869,870,879,889,900,904,911],{"__ignoreMap":33},[38,871,872,874,877],{"class":40,"line":41},[38,873,624],{"class":623},[38,875,876],{"class":627}," test",[38,878,631],{"class":70},[38,880,881,884,886],{"class":40,"line":63},[38,882,883],{"class":44},"    value ",[38,885,49],{"class":48},[38,887,888],{"class":229}," 5\n",[38,890,891,894,896,898],{"class":40,"line":352},[38,892,893],{"class":66},"    print",[38,895,71],{"class":70},[38,897,847],{"class":66},[38,899,850],{"class":70},[38,901,902],{"class":40,"line":548},[38,903,349],{"emptyLinePlaceholder":348},[38,905,906,909],{"class":40,"line":659},[38,907,908],{"class":74},"test",[38,910,656],{"class":70},[38,912,913,915,917,919],{"class":40,"line":765},[38,914,67],{"class":66},[38,916,71],{"class":70},[38,918,859],{"class":66},[38,920,850],{"class":70},[100,922,923,929],{},[103,924,925,928],{},[35,926,927],{},"locals()"," shows names available in the current local scope",[103,930,931,934],{},[35,932,933],{},"globals()"," shows names available at the top level of the file",[14,936,937],{},"You can also run your script from the terminal to see the full traceback:",[28,939,943],{"className":940,"code":941,"language":942,"meta":33,"style":33},"language-bash shiki shiki-themes material-theme-lighter github-light github-dark","python your_script.py\n","bash",[35,944,945],{"__ignoreMap":33},[38,946,947,950],{"class":40,"line":41},[38,948,32],{"class":949},"sbgvK",[38,951,952],{"class":56}," your_script.py\n",[14,954,955,956,189],{},"If you want a step-by-step debugging process, read ",[185,957,959],{"href":958},"\u002Fhow-to\u002Fhow-to-debug-python-code-beginner-guide","How to debug Python code",[23,961,963],{"id":962},"common-mistakes","Common mistakes",[14,965,966],{},"These are the most common causes of this error:",[100,968,969,972,975,978,981,984],{},[103,970,971],{},"Using a variable before assignment",[103,973,974],{},"Misspelled variable or function name",[103,976,977],{},"Wrong uppercase or lowercase letters",[103,979,980],{},"Forgotten import statement",[103,982,983],{},"Trying to use a local variable outside its function",[103,985,986],{},"Assuming a global variable already exists",[14,988,989],{},"Remember that Python is case-sensitive. These are different names:",[28,991,993],{"className":30,"code":992,"language":32,"meta":33,"style":33},"count = 5\nprint(Count)\n",[35,994,995,1004],{"__ignoreMap":33},[38,996,997,1000,1002],{"class":40,"line":41},[38,998,999],{"class":44},"count ",[38,1001,49],{"class":48},[38,1003,888],{"class":229},[38,1005,1006,1008,1010,1013],{"class":40,"line":63},[38,1007,67],{"class":66},[38,1009,71],{"class":70},[38,1011,1012],{"class":74},"Count",[38,1014,78],{"class":70},[14,1016,1017],{},"This causes:",[28,1019,1021],{"className":30,"code":1020,"language":32,"meta":33,"style":33},"NameError: name 'Count' is not defined\n",[35,1022,1023],{"__ignoreMap":33},[38,1024,1025,1027,1029,1031,1033,1035,1037,1039,1041],{"class":40,"line":41},[38,1026,84],{"class":127},[38,1028,130],{"class":70},[38,1030,133],{"class":44},[38,1032,136],{"class":52},[38,1034,1012],{"class":56},[38,1036,136],{"class":52},[38,1038,143],{"class":48},[38,1040,146],{"class":48},[38,1042,149],{"class":44},[14,1044,1045,1046,790,1049,1051],{},"Because ",[35,1047,1048],{},"count",[35,1050,1012],{}," are not the same.",[23,1053,1055],{"id":1054},"faq","FAQ",[200,1057,1059],{"id":1058},"is-this-the-same-as-nameerror-name-is-not-defined","Is this the same as NameError: name is not defined?",[14,1061,1062,1063,1065],{},"Yes. ",[18,1064,155],{}," is older wording. Both mean Python cannot find a name.",[200,1067,1069],{"id":1068},"can-a-typo-really-cause-this-error","Can a typo really cause this error?",[14,1071,1072,1073,189],{},"Yes. Even a small spelling difference or wrong capitalization can cause ",[35,1074,84],{},[200,1076,1078],{"id":1077},"why-does-this-happen-inside-a-function","Why does this happen inside a function?",[14,1080,1081],{},"The function may be using a name that was never passed in, never defined, or only exists in another scope.",[200,1083,1085],{"id":1084},"how-do-i-fix-a-missing-module-name","How do I fix a missing module name?",[14,1087,1088,1089,1092,1093,189],{},"Import the module first, such as ",[35,1090,1091],{},"import math",", before using ",[35,1094,1095],{},"math.sqrt()",[23,1097,1099],{"id":1098},"see-also","See also",[100,1101,1102,1108,1114,1118,1122,1126],{},[103,1103,1104],{},[185,1105,1107],{"href":1106},"\u002Ferrors\u002Fnameerror-name-is-not-defined-fix","NameError: name is not defined",[103,1109,1110],{},[185,1111,1113],{"href":1112},"\u002Ferrors\u002Fnameerror-in-python-causes-and-fixes","NameError in Python: causes and fixes",[103,1115,1116],{},[185,1117,794],{"href":793},[103,1119,1120],{},[185,1121,188],{"href":187},[103,1123,1124],{},[185,1125,386],{"href":385},[103,1127,1128],{},[185,1129,959],{"href":958},[1131,1132,1133],"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 .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 .sptTA, html code.shiki .sptTA{--shiki-light:#6182B8;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sP7_E, html code.shiki .sP7_E{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#E1E4E8}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 .sZMiF, html code.shiki .sZMiF{--shiki-light:#E2931D;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .srdBf, html code.shiki .srdBf{--shiki-light:#F76D47;--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 .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 .sbgvK, html code.shiki .sbgvK{--shiki-light:#E2931D;--shiki-default:#6F42C1;--shiki-dark:#B392F0}",{"title":33,"searchDepth":63,"depth":63,"links":1135},[1136,1137,1138,1139,1144,1145,1148,1149,1150,1156],{"id":25,"depth":63,"text":26},{"id":88,"depth":63,"text":89},{"id":159,"depth":63,"text":160},{"id":192,"depth":63,"text":193,"children":1140},[1141,1142,1143],{"id":202,"depth":352,"text":203},{"id":271,"depth":352,"text":272},{"id":389,"depth":352,"text":390},{"id":459,"depth":63,"text":460},{"id":591,"depth":63,"text":592,"children":1146},[1147],{"id":612,"depth":352,"text":613},{"id":797,"depth":63,"text":798},{"id":962,"depth":63,"text":963},{"id":1054,"depth":63,"text":1055,"children":1151},[1152,1153,1154,1155],{"id":1058,"depth":352,"text":1059},{"id":1068,"depth":352,"text":1069},{"id":1077,"depth":352,"text":1078},{"id":1084,"depth":352,"text":1085},{"id":1098,"depth":63,"text":1099},"Master nameerror global name not defined fix in our comprehensive Python beginner guide.","md",{},"\u002Ferrors\u002Fnameerror-global-name-not-defined-fix",{"title":5,"description":1157},"errors\u002Fnameerror-global-name-not-defined-fix","uQ9fIY2nfzB8DkQ7dBUfB2l33D59SL5mpxRKar-qCCA",1777585480722]