[{"data":1,"prerenderedAt":1134},["ShallowReactive",2],{"doc-\u002Fglossary\u002Fwhat-is-error-handling-in-python":3},{"id":4,"title":5,"body":6,"description":1126,"extension":1127,"meta":1128,"navigation":1129,"path":1130,"seo":1131,"stem":1132,"__hash__":1133},"content\u002Fglossary\u002Fwhat-is-error-handling-in-python.md","What Is Error Handling in Python?",{"type":7,"value":8,"toc":1099},"minimark",[9,13,17,20,32,37,40,172,175,207,210,214,217,220,234,247,251,254,257,271,274,291,295,298,322,325,342,346,349,354,360,364,369,374,381,386,391,398,402,405,488,492,516,519,524,532,537,543,546,549,652,662,666,669,686,689,738,741,787,790,794,797,816,823,830,833,853,860,864,867,870,887,898,909,913,916,946,949,964,1016,1019,1023,1027,1030,1034,1037,1041,1044,1048,1051,1055,1058,1062,1095],[10,11,5],"h1",{"id":12},"what-is-error-handling-in-python",[14,15,16],"p",{},"Error handling is the way a Python program deals with problems while it is running.",[14,18,19],{},"Instead of crashing as soon as something goes wrong, your code can respond in a controlled way. This is useful when working with user input, files, calculations, and other data that may not always be valid.",[14,21,22,23,27,28,31],{},"In Python, error handling is commonly done with ",[24,25,26],"code",{},"try"," and ",[24,29,30],{},"except",".",[33,34,36],"h2",{"id":35},"a-quick-example","A quick example",[14,38,39],{},"Here is a simple example of error handling:",[41,42,47],"pre",{"className":43,"code":44,"language":45,"meta":46,"style":46},"language-python shiki shiki-themes material-theme-lighter github-light github-dark","try:\n    number = int(input(\"Enter a number: \"))\n    print(10 \u002F number)\nexcept ValueError:\n    print(\"Please enter a valid whole number.\")\nexcept ZeroDivisionError:\n    print(\"You cannot divide by zero.\")\n","python","",[24,48,49,61,98,120,130,146,156],{"__ignoreMap":46},[50,51,54,57],"span",{"class":52,"line":53},"line",1,[50,55,26],{"class":56},"sVHd0",[50,58,60],{"class":59},"sP7_E",":\n",[50,62,64,68,72,76,79,83,85,89,93,95],{"class":52,"line":63},2,[50,65,67],{"class":66},"su5hD","    number ",[50,69,71],{"class":70},"smGrS","=",[50,73,75],{"class":74},"sZMiF"," int",[50,77,78],{"class":59},"(",[50,80,82],{"class":81},"sptTA","input",[50,84,78],{"class":59},[50,86,88],{"class":87},"sjJ54","\"",[50,90,92],{"class":91},"s_sjI","Enter a number: ",[50,94,88],{"class":87},[50,96,97],{"class":59},"))\n",[50,99,101,104,106,110,113,117],{"class":52,"line":100},3,[50,102,103],{"class":81},"    print",[50,105,78],{"class":59},[50,107,109],{"class":108},"srdBf","10",[50,111,112],{"class":70}," \u002F",[50,114,116],{"class":115},"slqww"," number",[50,118,119],{"class":59},")\n",[50,121,123,125,128],{"class":52,"line":122},4,[50,124,30],{"class":56},[50,126,127],{"class":74}," ValueError",[50,129,60],{"class":59},[50,131,133,135,137,139,142,144],{"class":52,"line":132},5,[50,134,103],{"class":81},[50,136,78],{"class":59},[50,138,88],{"class":87},[50,140,141],{"class":91},"Please enter a valid whole number.",[50,143,88],{"class":87},[50,145,119],{"class":59},[50,147,149,151,154],{"class":52,"line":148},6,[50,150,30],{"class":56},[50,152,153],{"class":74}," ZeroDivisionError",[50,155,60],{"class":59},[50,157,159,161,163,165,168,170],{"class":52,"line":158},7,[50,160,103],{"class":81},[50,162,78],{"class":59},[50,164,88],{"class":87},[50,166,167],{"class":91},"You cannot divide by zero.",[50,169,88],{"class":87},[50,171,119],{"class":59},[14,173,174],{},"What this does:",[176,177,178,185,195,204],"ul",{},[179,180,181,182,184],"li",{},"The code in ",[24,183,26],{}," might fail.",[179,186,187,188,191,192,31],{},"If the user enters text like ",[24,189,190],{},"\"hello\"",", Python raises a ",[24,193,194],{},"ValueError",[179,196,197,198,191,201,31],{},"If the user enters ",[24,199,200],{},"0",[24,202,203],{},"ZeroDivisionError",[179,205,206],{},"Instead of showing a long traceback, the program prints a clear message.",[14,208,209],{},"This is the basic idea of error handling: prepare for problems and respond safely.",[33,211,213],{"id":212},"what-error-handling-means","What error handling means",[14,215,216],{},"Error handling is how a program deals with problems during runtime.",[14,218,219],{},"It helps your code:",[176,221,222,225,228,231],{},[179,223,224],{},"respond to errors instead of stopping suddenly",[179,226,227],{},"show useful messages",[179,229,230],{},"recover when possible",[179,232,233],{},"stop safely when needed",[14,235,236,237,241,242,31],{},"In Python, these problems are usually called ",[238,239,240],"strong",{},"exceptions",". If that term is new, see ",[243,244,246],"a",{"href":245},"\u002Flearn\u002Fpython-errors-and-exceptions-explained\u002F","Python errors and exceptions explained",[33,248,250],{"id":249},"why-error-handling-is-useful","Why error handling is useful",[14,252,253],{},"Error handling is useful because real programs often deal with unpredictable input and data.",[14,255,256],{},"It can help you:",[176,258,259,262,265,268],{},[179,260,261],{},"prevent the whole program from crashing on common mistakes",[179,263,264],{},"show clear messages to the user",[179,266,267],{},"continue running when that makes sense",[179,269,270],{},"stop safely when continuing would cause bigger problems",[14,272,273],{},"This is especially important when working with:",[176,275,276,279,282,285,288],{},[179,277,278],{},"user input",[179,280,281],{},"files",[179,283,284],{},"web data",[179,286,287],{},"external APIs",[179,289,290],{},"calculations",[33,292,294],{"id":293},"common-situations-where-errors-happen","Common situations where errors happen",[14,296,297],{},"Beginners often see errors in situations like these:",[176,299,300,310,313,316,319],{},[179,301,302,303,306,307],{},"converting text to a number with ",[24,304,305],{},"int()"," or ",[24,308,309],{},"float()",[179,311,312],{},"opening a file that does not exist",[179,314,315],{},"using a list index that is too large",[179,317,318],{},"looking up a missing dictionary key",[179,320,321],{},"dividing by zero",[14,323,324],{},"Examples:",[176,326,327,330,333,336,339],{},[179,328,329],{},"User enters text when a number is expected",[179,331,332],{},"Program tries to open a missing file",[179,334,335],{},"Code uses an invalid list index",[179,337,338],{},"Program divides by zero",[179,340,341],{},"Code accesses a missing dictionary key",[33,343,345],{"id":344},"basic-parts-of-python-error-handling","Basic parts of Python error handling",[14,347,348],{},"Python gives you a few main tools for handling errors.",[350,351,352],"h3",{"id":26},[24,353,26],{},[14,355,356,357,359],{},"The ",[24,358,26],{}," block contains code that may cause an error.",[350,361,362],{"id":30},[24,363,30],{},[14,365,356,366,368],{},[24,367,30],{}," block runs if an error happens.",[350,370,372],{"id":371},"else",[24,373,371],{},[14,375,356,376,378,379,31],{},[24,377,371],{}," block runs only if no error happens in ",[24,380,26],{},[350,382,384],{"id":383},"finally",[24,385,383],{},[14,387,356,388,390],{},[24,389,383],{}," block runs whether there is an error or not.",[14,392,393,394,31],{},"If you want the full syntax and examples, read ",[243,395,397],{"href":396},"\u002Flearn\u002Fusing-try-except-else-and-finally-in-python\u002F","using try, except, else, and finally in Python",[33,399,401],{"id":400},"beginner-example-to-include","Beginner example to include",[14,403,404],{},"A common beginner example is asking the user for a number.",[41,406,408],{"className":43,"code":407,"language":45,"meta":46,"style":46},"try:\n    number = int(input(\"Enter a number: \"))\n    print(\"Double:\", number * 2)\nexcept ValueError:\n    print(\"That was not a valid whole number.\")\n",[24,409,410,416,438,465,473],{"__ignoreMap":46},[50,411,412,414],{"class":52,"line":53},[50,413,26],{"class":56},[50,415,60],{"class":59},[50,417,418,420,422,424,426,428,430,432,434,436],{"class":52,"line":63},[50,419,67],{"class":66},[50,421,71],{"class":70},[50,423,75],{"class":74},[50,425,78],{"class":59},[50,427,82],{"class":81},[50,429,78],{"class":59},[50,431,88],{"class":87},[50,433,92],{"class":91},[50,435,88],{"class":87},[50,437,97],{"class":59},[50,439,440,442,444,446,449,451,454,457,460,463],{"class":52,"line":100},[50,441,103],{"class":81},[50,443,78],{"class":59},[50,445,88],{"class":87},[50,447,448],{"class":91},"Double:",[50,450,88],{"class":87},[50,452,453],{"class":59},",",[50,455,456],{"class":115}," number ",[50,458,459],{"class":70},"*",[50,461,462],{"class":108}," 2",[50,464,119],{"class":59},[50,466,467,469,471],{"class":52,"line":122},[50,468,30],{"class":56},[50,470,127],{"class":74},[50,472,60],{"class":59},[50,474,475,477,479,481,484,486],{"class":52,"line":132},[50,476,103],{"class":81},[50,478,78],{"class":59},[50,480,88],{"class":87},[50,482,483],{"class":91},"That was not a valid whole number.",[50,485,88],{"class":87},[50,487,119],{"class":59},[350,489,491],{"id":490},"what-happens-here","What happens here",[176,493,494,500,505,510],{},[179,495,496,499],{},[24,497,498],{},"input()"," gives you text",[179,501,502,504],{},[24,503,305],{}," tries to convert that text to a whole number",[179,506,507,508],{},"if the text is not a valid number, Python raises ",[24,509,194],{},[179,511,512,513,515],{},"the ",[24,514,30],{}," block shows a friendly message",[14,517,518],{},"Example:",[14,520,521],{},[238,522,523],{},"Input",[41,525,530],{"className":526,"code":528,"language":529,"meta":46},[527],"language-text","abc\n","text",[24,531,528],{"__ignoreMap":46},[14,533,534],{},[238,535,536],{},"Output",[41,538,541],{"className":539,"code":540,"language":529,"meta":46},[527],"That was not a valid whole number.\n",[24,542,540],{"__ignoreMap":46},[14,544,545],{},"Without error handling, the program would stop and show a traceback.",[14,547,548],{},"Here is a second simple example with a file:",[41,550,552],{"className":43,"code":551,"language":45,"meta":46,"style":46},"try:\n    with open(\"notes.txt\", \"r\") as file:\n        content = file.read()\n        print(content)\nexcept FileNotFoundError:\n    print(\"The file was not found.\")\n",[24,553,554,560,599,616,628,637],{"__ignoreMap":46},[50,555,556,558],{"class":52,"line":53},[50,557,26],{"class":56},[50,559,60],{"class":59},[50,561,562,565,568,570,572,575,577,579,582,585,587,590,593,597],{"class":52,"line":63},[50,563,564],{"class":56},"    with",[50,566,567],{"class":81}," open",[50,569,78],{"class":59},[50,571,88],{"class":87},[50,573,574],{"class":91},"notes.txt",[50,576,88],{"class":87},[50,578,453],{"class":59},[50,580,581],{"class":87}," \"",[50,583,584],{"class":91},"r",[50,586,88],{"class":87},[50,588,589],{"class":59},")",[50,591,592],{"class":56}," as",[50,594,596],{"class":595},"sMMDD"," file",[50,598,60],{"class":59},[50,600,601,604,606,608,610,613],{"class":52,"line":100},[50,602,603],{"class":66},"        content ",[50,605,71],{"class":70},[50,607,596],{"class":595},[50,609,31],{"class":59},[50,611,612],{"class":115},"read",[50,614,615],{"class":59},"()\n",[50,617,618,621,623,626],{"class":52,"line":122},[50,619,620],{"class":81},"        print",[50,622,78],{"class":59},[50,624,625],{"class":115},"content",[50,627,119],{"class":59},[50,629,630,632,635],{"class":52,"line":132},[50,631,30],{"class":56},[50,633,634],{"class":74}," FileNotFoundError",[50,636,60],{"class":59},[50,638,639,641,643,645,648,650],{"class":52,"line":148},[50,640,103],{"class":81},[50,642,78],{"class":59},[50,644,88],{"class":87},[50,646,647],{"class":91},"The file was not found.",[50,649,88],{"class":87},[50,651,119],{"class":59},[14,653,654,655,657,658,31],{},"If ",[24,656,574],{}," does not exist, the program handles the problem instead of crashing. For more help with this specific problem, see ",[243,659,661],{"href":660},"\u002Ferrors\u002Ffilenotfounderror-in-python-causes-and-fixes","FileNotFoundError in Python: causes and fixes",[33,663,665],{"id":664},"good-beginner-habits","Good beginner habits",[14,667,668],{},"When you start using error handling, these habits will help:",[176,670,671,674,680,683],{},[179,672,673],{},"catch specific errors when possible",[179,675,676,677,679],{},"keep the ",[24,678,26],{}," block small",[179,681,682],{},"write messages that clearly explain what went wrong",[179,684,685],{},"only handle errors you understand",[14,687,688],{},"For example, this is better:",[41,690,692],{"className":43,"code":691,"language":45,"meta":46,"style":46},"try:\n    number = int(user_input)\nexcept ValueError:\n    print(\"Please enter a valid number.\")\n",[24,693,694,700,715,723],{"__ignoreMap":46},[50,695,696,698],{"class":52,"line":53},[50,697,26],{"class":56},[50,699,60],{"class":59},[50,701,702,704,706,708,710,713],{"class":52,"line":63},[50,703,67],{"class":66},[50,705,71],{"class":70},[50,707,75],{"class":74},[50,709,78],{"class":59},[50,711,712],{"class":115},"user_input",[50,714,119],{"class":59},[50,716,717,719,721],{"class":52,"line":100},[50,718,30],{"class":56},[50,720,127],{"class":74},[50,722,60],{"class":59},[50,724,725,727,729,731,734,736],{"class":52,"line":122},[50,726,103],{"class":81},[50,728,78],{"class":59},[50,730,88],{"class":87},[50,732,733],{"class":91},"Please enter a valid number.",[50,735,88],{"class":87},[50,737,119],{"class":59},[14,739,740],{},"Than this:",[41,742,744],{"className":43,"code":743,"language":45,"meta":46,"style":46},"try:\n    number = int(user_input)\nexcept:\n    print(\"Something went wrong.\")\n",[24,745,746,752,766,772],{"__ignoreMap":46},[50,747,748,750],{"class":52,"line":53},[50,749,26],{"class":56},[50,751,60],{"class":59},[50,753,754,756,758,760,762,764],{"class":52,"line":63},[50,755,67],{"class":66},[50,757,71],{"class":70},[50,759,75],{"class":74},[50,761,78],{"class":59},[50,763,712],{"class":115},[50,765,119],{"class":59},[50,767,768,770],{"class":52,"line":100},[50,769,30],{"class":56},[50,771,60],{"class":59},[50,773,774,776,778,780,783,785],{"class":52,"line":122},[50,775,103],{"class":81},[50,777,78],{"class":59},[50,779,88],{"class":87},[50,781,782],{"class":91},"Something went wrong.",[50,784,88],{"class":87},[50,786,119],{"class":59},[14,788,789],{},"The first version is clearer and easier to debug.",[33,791,793],{"id":792},"common-beginner-mistakes","Common beginner mistakes",[14,795,796],{},"Here are some common mistakes:",[176,798,799,805,810,813],{},[179,800,801,802,804],{},"using a bare ",[24,803,30],{}," for everything",[179,806,807,808],{},"putting too much code inside ",[24,809,26],{},[179,811,812],{},"catching an error but doing nothing",[179,814,815],{},"confusing syntax errors with runtime errors",[14,817,818,819,822],{},"A ",[238,820,821],{},"syntax error"," means your code is written incorrectly, so Python cannot run it.",[14,824,825,826,829],{},"An ",[238,827,828],{},"exception"," usually happens while the program is already running.",[14,831,832],{},"For example:",[41,834,836],{"className":43,"code":835,"language":45,"meta":46,"style":46},"print(\"Hello\"\n",[24,837,838],{"__ignoreMap":46},[50,839,840,843,845,847,850],{"class":52,"line":53},[50,841,842],{"class":81},"print",[50,844,78],{"class":59},[50,846,88],{"class":87},[50,848,849],{"class":91},"Hello",[50,851,852],{"class":87},"\"\n",[14,854,855,856,27,858,31],{},"This is a syntax error, not something you would normally handle with ",[24,857,26],{},[24,859,30],{},[33,861,863],{"id":862},"what-this-page-should-not-cover-in-depth","What this page should not cover in depth",[14,865,866],{},"This page is only a definition and overview.",[14,868,869],{},"It does not go deep into:",[176,871,872,881,884],{},[179,873,874,875,877,878,880],{},"full ",[24,876,26],{},"\u002F",[24,879,30],{}," syntax",[179,882,883],{},"long lists of exception types",[179,885,886],{},"advanced exception handling patterns",[14,888,889,890,306,894,31],{},"For practical usage, see ",[243,891,893],{"href":892},"\u002Fhow-to\u002Fhow-to-use-try-except-blocks-in-python\u002F","how to use try-except blocks in Python",[243,895,897],{"href":896},"\u002Fhow-to\u002Fhow-to-handle-exceptions-in-python\u002F","how to handle exceptions in Python",[14,899,900,901,306,905,31],{},"If you need help with a specific error, go to pages such as ",[243,902,904],{"href":903},"\u002Ferrors\u002Fvalueerror-in-python-causes-and-fixes\u002F","ValueError in Python: causes and fixes",[243,906,908],{"href":907},"\u002Ferrors\u002Fzerodivisionerror-in-python-causes-and-fixes","ZeroDivisionError in Python: causes and fixes",[33,910,912],{"id":911},"next-steps-for-the-reader","Next steps for the reader",[14,914,915],{},"A good path forward is:",[176,917,918,921,935,938],{},[179,919,920],{},"learn what Python errors and exceptions are",[179,922,923,924,926,927,926,929,931,932,934],{},"understand how ",[24,925,26],{},", ",[24,928,30],{},[24,930,371],{},", and ",[24,933,383],{}," work",[179,936,937],{},"visit specific error pages when solving a real problem",[179,939,940,941,945],{},"learn how to ",[243,942,944],{"href":943},"\u002Flearn\u002Fraising-exceptions-in-python\u002F","raise exceptions in Python"," when you want your own code to signal a problem",[14,947,948],{},"Useful commands while learning:",[41,950,954],{"className":951,"code":952,"language":953,"meta":46,"style":46},"language-bash shiki shiki-themes material-theme-lighter github-light github-dark","python your_script.py\n","bash",[24,955,956],{"__ignoreMap":46},[50,957,958,961],{"class":52,"line":53},[50,959,45],{"class":960},"sbgvK",[50,962,963],{"class":91}," your_script.py\n",[41,965,967],{"className":43,"code":966,"language":45,"meta":46,"style":46},"print(type(value))\nprint(value)\nhelp(ValueError)\nhelp(ZeroDivisionError)\n",[24,968,969,985,995,1006],{"__ignoreMap":46},[50,970,971,973,975,978,980,983],{"class":52,"line":53},[50,972,842],{"class":81},[50,974,78],{"class":59},[50,976,977],{"class":74},"type",[50,979,78],{"class":59},[50,981,982],{"class":115},"value",[50,984,97],{"class":59},[50,986,987,989,991,993],{"class":52,"line":63},[50,988,842],{"class":81},[50,990,78],{"class":59},[50,992,982],{"class":115},[50,994,119],{"class":59},[50,996,997,1000,1002,1004],{"class":52,"line":100},[50,998,999],{"class":81},"help",[50,1001,78],{"class":59},[50,1003,194],{"class":74},[50,1005,119],{"class":59},[50,1007,1008,1010,1012,1014],{"class":52,"line":122},[50,1009,999],{"class":81},[50,1011,78],{"class":59},[50,1013,203],{"class":74},[50,1015,119],{"class":59},[14,1017,1018],{},"These can help you inspect values and understand the error type you are seeing.",[33,1020,1022],{"id":1021},"faq","FAQ",[350,1024,1026],{"id":1025},"is-error-handling-the-same-as-fixing-errors","Is error handling the same as fixing errors?",[14,1028,1029],{},"Not exactly. Error handling means your program is prepared for possible problems and responds safely when they happen.",[350,1031,1033],{"id":1032},"what-is-the-difference-between-an-error-and-an-exception","What is the difference between an error and an exception?",[14,1035,1036],{},"Beginners often use the words loosely. In Python, an exception is the object raised when something goes wrong during runtime.",[350,1038,1040],{"id":1039},"should-i-use-try-except-everywhere","Should I use try-except everywhere?",[14,1042,1043],{},"No. Use it where errors are likely and where you know how to respond.",[350,1045,1047],{"id":1046},"why-not-use-bare-except","Why not use bare except?",[14,1049,1050],{},"It can hide the real problem and make debugging harder. Catch specific exception types instead.",[350,1052,1054],{"id":1053},"can-a-program-continue-after-an-error","Can a program continue after an error?",[14,1056,1057],{},"Yes, if the error is handled properly and your code knows what to do next.",[33,1059,1061],{"id":1060},"see-also","See also",[176,1063,1064,1068,1073,1078,1083,1087,1091],{},[179,1065,1066],{},[243,1067,246],{"href":245},[179,1069,1070],{},[243,1071,1072],{"href":396},"Using try, except, else, and finally in Python",[179,1074,1075],{},[243,1076,1077],{"href":896},"How to handle exceptions in Python",[179,1079,1080],{},[243,1081,1082],{"href":892},"How to use try-except blocks in Python",[179,1084,1085],{},[243,1086,904],{"href":903},[179,1088,1089],{},[243,1090,661],{"href":660},[179,1092,1093],{},[243,1094,908],{"href":907},[1096,1097,1098],"style",{},"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 .sP7_E, html code.shiki .sP7_E{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#E1E4E8}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 .sZMiF, html code.shiki .sZMiF{--shiki-light:#E2931D;--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 .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 .srdBf, html code.shiki .srdBf{--shiki-light:#F76D47;--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 .sMMDD, html code.shiki .sMMDD{--shiki-light:#90A4AE;--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .sbgvK, html code.shiki .sbgvK{--shiki-light:#E2931D;--shiki-default:#6F42C1;--shiki-dark:#B392F0}",{"title":46,"searchDepth":63,"depth":63,"links":1100},[1101,1102,1103,1104,1105,1111,1114,1115,1116,1117,1118,1125],{"id":35,"depth":63,"text":36},{"id":212,"depth":63,"text":213},{"id":249,"depth":63,"text":250},{"id":293,"depth":63,"text":294},{"id":344,"depth":63,"text":345,"children":1106},[1107,1108,1109,1110],{"id":26,"depth":100,"text":26},{"id":30,"depth":100,"text":30},{"id":371,"depth":100,"text":371},{"id":383,"depth":100,"text":383},{"id":400,"depth":63,"text":401,"children":1112},[1113],{"id":490,"depth":100,"text":491},{"id":664,"depth":63,"text":665},{"id":792,"depth":63,"text":793},{"id":862,"depth":63,"text":863},{"id":911,"depth":63,"text":912},{"id":1021,"depth":63,"text":1022,"children":1119},[1120,1121,1122,1123,1124],{"id":1025,"depth":100,"text":1026},{"id":1032,"depth":100,"text":1033},{"id":1039,"depth":100,"text":1040},{"id":1046,"depth":100,"text":1047},{"id":1053,"depth":100,"text":1054},{"id":1060,"depth":63,"text":1061},"Master what is error handling in python in our comprehensive Python beginner guide.","md",{},true,"\u002Fglossary\u002Fwhat-is-error-handling-in-python",{"title":5,"description":1126},"glossary\u002Fwhat-is-error-handling-in-python","E7NUtlPZ1uqSXZqOLPDGAiIYvYOKsWkZXIHKceW49dg",1777585468129]