[{"data":1,"prerenderedAt":1280},["ShallowReactive",2],{"doc-\u002Ferrors\u002Ftypeerror-str-object-cannot-be-interpreted-as-an-integer-fix":3},{"id":4,"title":5,"body":6,"description":1273,"extension":1274,"meta":1275,"navigation":96,"path":1276,"seo":1277,"stem":1278,"__hash__":1279},"content\u002Ferrors\u002Ftypeerror-str-object-cannot-be-interpreted-as-an-integer-fix.md","TypeError: 'str' object cannot be interpreted as an integer (Fix)",{"type":7,"value":8,"toc":1244},"minimark",[9,19,30,35,136,139,143,146,165,168,188,192,195,198,218,221,262,265,291,298,302,305,325,328,407,410,414,423,478,484,495,499,509,567,573,604,609,661,663,672,676,695,702,709,712,744,755,760,776,783,790,794,797,800,864,868,894,898,1017,1023,1027,1030,1051,1054,1110,1116,1120,1127,1139,1143,1146,1156,1171,1179,1184,1188,1197,1201,1240],[10,11,13,14,18],"h1",{"id":12},"typeerror-str-object-cannot-be-interpreted-as-an-integer-fix","TypeError: ",[15,16,17],"code",{},"'str' object cannot be interpreted as an integer"," (Fix)",[20,21,22,23,29],"p",{},"Fix the Python error ",[24,25,26],"strong",{},[15,27,28],{},"TypeError: 'str' object cannot be interpreted as an integer",". This page explains what the error means, common causes, and the fastest ways to correct your code.",[31,32,34],"h2",{"id":33},"quick-fix","Quick fix",[36,37,42],"pre",{"className":38,"code":39,"language":40,"meta":41,"style":41},"language-python shiki shiki-themes material-theme-lighter github-light github-dark","text = \"5\"\nnumber = int(text)\n\nfor i in range(number):\n    print(i)\n","python","",[15,43,44,68,91,98,123],{"__ignoreMap":41},[45,46,49,53,57,61,65],"span",{"class":47,"line":48},"line",1,[45,50,52],{"class":51},"su5hD","text ",[45,54,56],{"class":55},"smGrS","=",[45,58,60],{"class":59},"sjJ54"," \"",[45,62,64],{"class":63},"s_sjI","5",[45,66,67],{"class":59},"\"\n",[45,69,71,74,76,80,84,88],{"class":47,"line":70},2,[45,72,73],{"class":51},"number ",[45,75,56],{"class":55},[45,77,79],{"class":78},"sZMiF"," int",[45,81,83],{"class":82},"sP7_E","(",[45,85,87],{"class":86},"slqww","text",[45,89,90],{"class":82},")\n",[45,92,94],{"class":47,"line":93},3,[45,95,97],{"emptyLinePlaceholder":96},true,"\n",[45,99,101,105,108,111,115,117,120],{"class":47,"line":100},4,[45,102,104],{"class":103},"sVHd0","for",[45,106,107],{"class":51}," i ",[45,109,110],{"class":103},"in",[45,112,114],{"class":113},"sptTA"," range",[45,116,83],{"class":82},[45,118,119],{"class":86},"number",[45,121,122],{"class":82},"):\n",[45,124,126,129,131,134],{"class":47,"line":125},5,[45,127,128],{"class":113},"    print",[45,130,83],{"class":82},[45,132,133],{"class":86},"i",[45,135,90],{"class":82},[20,137,138],{},"This error happens when Python expects an integer, but you give it a string instead. Convert the string first if it contains a number.",[31,140,142],{"id":141},"what-this-error-means","What this error means",[20,144,145],{},"Python is telling you that:",[147,148,149,156,162],"ul",{},[150,151,152,153],"li",{},"It expected an ",[24,154,155],{},"integer",[150,157,158,159],{},"It received a ",[24,160,161],{},"string",[150,163,164],{},"It cannot use that string where a whole number is required",[20,166,167],{},"This often appears when working with:",[147,169,170,179,182,185],{},[150,171,172],{},[173,174,176],"a",{"href":175},"\u002Freference\u002Fpython-range-function-explained",[15,177,178],{},"range()",[150,180,181],{},"list indexes or slices",[150,183,184],{},"repetition operations",[150,186,187],{},"functions that require integer arguments",[31,189,191],{"id":190},"why-this-error-happens","Why this error happens",[20,193,194],{},"This error usually happens because a value looks like a number, but is actually text.",[20,196,197],{},"Common reasons:",[147,199,200,209,212,215],{},[150,201,202,208],{},[173,203,205],{"href":204},"\u002Freference\u002Fpython-input-function-explained",[15,206,207],{},"input()"," always returns a string",[150,210,211],{},"Numbers read from files or APIs may arrive as strings",[150,213,214],{},"Quotes around a number make it a string, not an integer",[150,216,217],{},"A variable may contain text when you think it contains a number",[20,219,220],{},"For example:",[36,222,224],{"className":38,"code":223,"language":40,"meta":41,"style":41},"count = \"5\"   # string\nprint(type(count))\n",[15,225,226,244],{"__ignoreMap":41},[45,227,228,231,233,235,237,240],{"class":47,"line":48},[45,229,230],{"class":51},"count ",[45,232,56],{"class":55},[45,234,60],{"class":59},[45,236,64],{"class":63},[45,238,239],{"class":59},"\"",[45,241,243],{"class":242},"sutJx","   # string\n",[45,245,246,249,251,254,256,259],{"class":47,"line":70},[45,247,248],{"class":113},"print",[45,250,83],{"class":82},[45,252,253],{"class":78},"type",[45,255,83],{"class":82},[45,257,258],{"class":86},"count",[45,260,261],{"class":82},"))\n",[20,263,264],{},"Output:",[36,266,268],{"className":38,"code":267,"language":40,"meta":41,"style":41},"\u003Cclass 'str'>\n",[15,269,270],{"__ignoreMap":41},[45,271,272,275,279,282,285,288],{"class":47,"line":48},[45,273,274],{"class":55},"\u003C",[45,276,278],{"class":277},"sbsja","class",[45,280,281],{"class":59}," '",[45,283,284],{"class":63},"str",[45,286,287],{"class":59},"'",[45,289,290],{"class":55},">\n",[20,292,293,294,297],{},"Even though ",[15,295,296],{},"\"5\""," looks numeric, Python treats it as text.",[31,299,301],{"id":300},"common-places-where-it-appears","Common places where it appears",[20,303,304],{},"You will often see this error in code like this:",[147,306,307,316,319,322],{},[150,308,309,312,313],{},[15,310,311],{},"range(\"5\")"," instead of ",[15,314,315],{},"range(5)",[150,317,318],{},"using a string as a list index",[150,320,321],{},"passing a string to a function that needs an integer",[150,323,324],{},"using user input directly in a loop",[20,326,327],{},"Example:",[36,329,331],{"className":38,"code":330,"language":40,"meta":41,"style":41},"items = [\"a\", \"b\", \"c\"]\nindex = \"1\"\n\nprint(items[index])\n",[15,332,333,371,385,389],{"__ignoreMap":41},[45,334,335,338,340,343,345,347,349,352,354,357,359,361,363,366,368],{"class":47,"line":48},[45,336,337],{"class":51},"items ",[45,339,56],{"class":55},[45,341,342],{"class":82}," [",[45,344,239],{"class":59},[45,346,173],{"class":63},[45,348,239],{"class":59},[45,350,351],{"class":82},",",[45,353,60],{"class":59},[45,355,356],{"class":63},"b",[45,358,239],{"class":59},[45,360,351],{"class":82},[45,362,60],{"class":59},[45,364,365],{"class":63},"c",[45,367,239],{"class":59},[45,369,370],{"class":82},"]\n",[45,372,373,376,378,380,383],{"class":47,"line":70},[45,374,375],{"class":51},"index ",[45,377,56],{"class":55},[45,379,60],{"class":59},[45,381,382],{"class":63},"1",[45,384,67],{"class":59},[45,386,387],{"class":47,"line":93},[45,388,97],{"emptyLinePlaceholder":96},[45,390,391,393,395,398,401,404],{"class":47,"line":100},[45,392,248],{"class":113},[45,394,83],{"class":82},[45,396,397],{"class":86},"items",[45,399,400],{"class":82},"[",[45,402,403],{"class":86},"index",[45,405,406],{"class":82},"])\n",[20,408,409],{},"This fails because list indexes must be integers, not strings.",[31,411,413],{"id":412},"example-that-causes-the-error","Example that causes the error",[20,415,416,417,419,420,422],{},"A very common case is using ",[15,418,207],{}," directly inside ",[15,421,178],{},".",[36,424,426],{"className":38,"code":425,"language":40,"meta":41,"style":41},"count = input(\"How many times? \")\n\nfor i in range(count):\n    print(i)\n",[15,427,428,448,452,468],{"__ignoreMap":41},[45,429,430,432,434,437,439,441,444,446],{"class":47,"line":48},[45,431,230],{"class":51},[45,433,56],{"class":55},[45,435,436],{"class":113}," input",[45,438,83],{"class":82},[45,440,239],{"class":59},[45,442,443],{"class":63},"How many times? ",[45,445,239],{"class":59},[45,447,90],{"class":82},[45,449,450],{"class":47,"line":70},[45,451,97],{"emptyLinePlaceholder":96},[45,453,454,456,458,460,462,464,466],{"class":47,"line":93},[45,455,104],{"class":103},[45,457,107],{"class":51},[45,459,110],{"class":103},[45,461,114],{"class":113},[45,463,83],{"class":82},[45,465,258],{"class":86},[45,467,122],{"class":82},[45,469,470,472,474,476],{"class":47,"line":100},[45,471,128],{"class":113},[45,473,83],{"class":82},[45,475,133],{"class":86},[45,477,90],{"class":82},[20,479,480,481,483],{},"Python raises the error because ",[15,482,258],{}," is a string.",[20,485,486,487,489,490,492,493,422],{},"If the user types ",[15,488,64],{},", the value is still ",[15,491,296],{},", not ",[15,494,64],{},[31,496,498],{"id":497},"how-to-fix-it","How to fix it",[20,500,501,502,508],{},"The usual fix is to convert the string with ",[173,503,505],{"href":504},"\u002Freference\u002Fpython-int-function-explained",[15,506,507],{},"int()"," before using it.",[36,510,512],{"className":38,"code":511,"language":40,"meta":41,"style":41},"count = int(input(\"How many times? \"))\n\nfor i in range(count):\n    print(i)\n",[15,513,514,537,541,557],{"__ignoreMap":41},[45,515,516,518,520,522,524,527,529,531,533,535],{"class":47,"line":48},[45,517,230],{"class":51},[45,519,56],{"class":55},[45,521,79],{"class":78},[45,523,83],{"class":82},[45,525,526],{"class":113},"input",[45,528,83],{"class":82},[45,530,239],{"class":59},[45,532,443],{"class":63},[45,534,239],{"class":59},[45,536,261],{"class":82},[45,538,539],{"class":47,"line":70},[45,540,97],{"emptyLinePlaceholder":96},[45,542,543,545,547,549,551,553,555],{"class":47,"line":93},[45,544,104],{"class":103},[45,546,107],{"class":51},[45,548,110],{"class":103},[45,550,114],{"class":113},[45,552,83],{"class":82},[45,554,258],{"class":86},[45,556,122],{"class":82},[45,558,559,561,563,565],{"class":47,"line":100},[45,560,128],{"class":113},[45,562,83],{"class":82},[45,564,133],{"class":86},[45,566,90],{"class":82},[20,568,569,570,572],{},"Output if the user enters ",[15,571,64],{},":",[36,574,576],{"className":38,"code":575,"language":40,"meta":41,"style":41},"0\n1\n2\n3\n4\n",[15,577,578,584,589,594,599],{"__ignoreMap":41},[45,579,580],{"class":47,"line":48},[45,581,583],{"class":582},"srdBf","0\n",[45,585,586],{"class":47,"line":70},[45,587,588],{"class":582},"1\n",[45,590,591],{"class":47,"line":93},[45,592,593],{"class":582},"2\n",[45,595,596],{"class":47,"line":100},[45,597,598],{"class":582},"3\n",[45,600,601],{"class":47,"line":125},[45,602,603],{"class":582},"4\n",[605,606,608],"h3",{"id":607},"another-example","Another example",[36,610,612],{"className":38,"code":611,"language":40,"meta":41,"style":41},"text = \"10\"\nnumber = int(text)\n\nprint(number + 2)\n",[15,613,614,627,641,645],{"__ignoreMap":41},[45,615,616,618,620,622,625],{"class":47,"line":48},[45,617,52],{"class":51},[45,619,56],{"class":55},[45,621,60],{"class":59},[45,623,624],{"class":63},"10",[45,626,67],{"class":59},[45,628,629,631,633,635,637,639],{"class":47,"line":70},[45,630,73],{"class":51},[45,632,56],{"class":55},[45,634,79],{"class":78},[45,636,83],{"class":82},[45,638,87],{"class":86},[45,640,90],{"class":82},[45,642,643],{"class":47,"line":93},[45,644,97],{"emptyLinePlaceholder":96},[45,646,647,649,651,653,656,659],{"class":47,"line":100},[45,648,248],{"class":113},[45,650,83],{"class":82},[45,652,73],{"class":86},[45,654,655],{"class":55},"+",[45,657,658],{"class":582}," 2",[45,660,90],{"class":82},[20,662,264],{},[36,664,666],{"className":38,"code":665,"language":40,"meta":41,"style":41},"12\n",[15,667,668],{"__ignoreMap":41},[45,669,670],{"class":47,"line":48},[45,671,665],{"class":582},[605,673,675],{"id":674},"good-things-to-check","Good things to check",[147,677,678,683,689,692],{},[150,679,680,681],{},"Convert the value with ",[15,682,507],{},[150,684,685,686],{},"Check the type with ",[15,687,688],{},"type()",[150,690,691],{},"Make sure the string contains a valid whole number",[150,693,694],{},"Validate input before conversion",[20,696,697,698,422],{},"If you need more help with conversion, see ",[173,699,701],{"href":700},"\u002Fhow-to\u002Fhow-to-convert-string-to-int-in-python","how to convert a string to int in Python",[31,703,705,706,708],{"id":704},"if-int-also-fails","If ",[15,707,507],{}," also fails",[20,710,711],{},"Sometimes you fix one problem and get a new one:",[36,713,715],{"className":38,"code":714,"language":40,"meta":41,"style":41},"text = \"3.5\"\nnumber = int(text)\n",[15,716,717,730],{"__ignoreMap":41},[45,718,719,721,723,725,728],{"class":47,"line":48},[45,720,52],{"class":51},[45,722,56],{"class":55},[45,724,60],{"class":59},[45,726,727],{"class":63},"3.5",[45,729,67],{"class":59},[45,731,732,734,736,738,740,742],{"class":47,"line":70},[45,733,73],{"class":51},[45,735,56],{"class":55},[45,737,79],{"class":78},[45,739,83],{"class":82},[45,741,87],{"class":86},[45,743,90],{"class":82},[20,745,746,747,750,751,754],{},"This raises a ",[15,748,749],{},"ValueError",", because ",[15,752,753],{},"\"3.5\""," is not a valid integer string.",[20,756,757,758,572],{},"Other examples that fail with ",[15,759,507],{},[147,761,762,766,771],{},[150,763,764],{},[15,765,753],{},[150,767,768],{},[15,769,770],{},"\"ten\"",[150,772,773],{},[15,774,775],{},"\"\"",[20,777,778,779,782],{},"If decimals are allowed, use ",[15,780,781],{},"float()"," instead. If not, clean and validate the input first.",[20,784,785,786],{},"Related page: ",[173,787,789],{"href":788},"\u002Ferrors\u002Fvalueerror-invalid-literal-for-int-with-base-10-fix","ValueError: invalid literal for int() with base 10",[31,791,793],{"id":792},"debugging-steps","Debugging steps",[20,795,796],{},"If you are not sure where the problem is coming from, check the value before the line that fails.",[20,798,799],{},"Useful debugging commands:",[36,801,803],{"className":38,"code":802,"language":40,"meta":41,"style":41},"print(value)\nprint(type(value))\nprint(repr(value))\nprint(isinstance(value, int))\n",[15,804,805,816,830,845],{"__ignoreMap":41},[45,806,807,809,811,814],{"class":47,"line":48},[45,808,248],{"class":113},[45,810,83],{"class":82},[45,812,813],{"class":86},"value",[45,815,90],{"class":82},[45,817,818,820,822,824,826,828],{"class":47,"line":70},[45,819,248],{"class":113},[45,821,83],{"class":82},[45,823,253],{"class":78},[45,825,83],{"class":82},[45,827,813],{"class":86},[45,829,261],{"class":82},[45,831,832,834,836,839,841,843],{"class":47,"line":93},[45,833,248],{"class":113},[45,835,83],{"class":82},[45,837,838],{"class":113},"repr",[45,840,83],{"class":82},[45,842,813],{"class":86},[45,844,261],{"class":82},[45,846,847,849,851,854,856,858,860,862],{"class":47,"line":100},[45,848,248],{"class":113},[45,850,83],{"class":82},[45,852,853],{"class":113},"isinstance",[45,855,83],{"class":82},[45,857,813],{"class":86},[45,859,351],{"class":82},[45,861,79],{"class":78},[45,863,261],{"class":82},[605,865,867],{"id":866},"what-each-one-helps-you-see","What each one helps you see",[147,869,870,876,882,888],{},[150,871,872,875],{},[15,873,874],{},"print(value)"," shows the current value",[150,877,878,881],{},[15,879,880],{},"print(type(value))"," shows whether it is a string or integer",[150,883,884,887],{},[15,885,886],{},"print(repr(value))"," helps reveal spaces or hidden characters",[150,889,890,893],{},[15,891,892],{},"isinstance(value, int)"," checks whether the value is an integer",[605,895,897],{"id":896},"example-debugging-session","Example debugging session",[36,899,901],{"className":38,"code":900,"language":40,"meta":41,"style":41},"value = input(\"Enter a number: \")\n\nprint(value)\nprint(type(value))\nprint(repr(value))\nprint(isinstance(value, int))\n\nfor i in range(value):\n    print(i)\n",[15,902,903,923,927,937,951,965,984,989,1006],{"__ignoreMap":41},[45,904,905,908,910,912,914,916,919,921],{"class":47,"line":48},[45,906,907],{"class":51},"value ",[45,909,56],{"class":55},[45,911,436],{"class":113},[45,913,83],{"class":82},[45,915,239],{"class":59},[45,917,918],{"class":63},"Enter a number: ",[45,920,239],{"class":59},[45,922,90],{"class":82},[45,924,925],{"class":47,"line":70},[45,926,97],{"emptyLinePlaceholder":96},[45,928,929,931,933,935],{"class":47,"line":93},[45,930,248],{"class":113},[45,932,83],{"class":82},[45,934,813],{"class":86},[45,936,90],{"class":82},[45,938,939,941,943,945,947,949],{"class":47,"line":100},[45,940,248],{"class":113},[45,942,83],{"class":82},[45,944,253],{"class":78},[45,946,83],{"class":82},[45,948,813],{"class":86},[45,950,261],{"class":82},[45,952,953,955,957,959,961,963],{"class":47,"line":125},[45,954,248],{"class":113},[45,956,83],{"class":82},[45,958,838],{"class":113},[45,960,83],{"class":82},[45,962,813],{"class":86},[45,964,261],{"class":82},[45,966,968,970,972,974,976,978,980,982],{"class":47,"line":967},6,[45,969,248],{"class":113},[45,971,83],{"class":82},[45,973,853],{"class":113},[45,975,83],{"class":82},[45,977,813],{"class":86},[45,979,351],{"class":82},[45,981,79],{"class":78},[45,983,261],{"class":82},[45,985,987],{"class":47,"line":986},7,[45,988,97],{"emptyLinePlaceholder":96},[45,990,992,994,996,998,1000,1002,1004],{"class":47,"line":991},8,[45,993,104],{"class":103},[45,995,107],{"class":51},[45,997,110],{"class":103},[45,999,114],{"class":113},[45,1001,83],{"class":82},[45,1003,813],{"class":86},[45,1005,122],{"class":82},[45,1007,1009,1011,1013,1015],{"class":47,"line":1008},9,[45,1010,128],{"class":113},[45,1012,83],{"class":82},[45,1014,133],{"class":86},[45,1016,90],{"class":82},[20,1018,1019,1020,1022],{},"If the user enters ",[15,1021,64],{},", the debug output will show that the value is still a string.",[31,1024,1026],{"id":1025},"common-mistakes","Common mistakes",[20,1028,1029],{},"These are some of the most common causes of this error:",[147,1031,1032,1039,1042,1045,1048],{},[150,1033,1034,1035,419,1037],{},"Using ",[15,1036,207],{},[15,1038,178],{},[150,1040,1041],{},"Storing numbers as quoted strings",[150,1043,1044],{},"Reading numeric text from a file and not converting it",[150,1046,1047],{},"Passing a string index to a list or tuple operation",[150,1049,1050],{},"Using command-line arguments without conversion",[20,1052,1053],{},"Also watch for cases where a variable is reassigned:",[36,1055,1057],{"className":38,"code":1056,"language":40,"meta":41,"style":41},"count = 5\ncount = \"5\"\n\nfor i in range(count):\n    print(i)\n",[15,1058,1059,1068,1080,1084,1100],{"__ignoreMap":41},[45,1060,1061,1063,1065],{"class":47,"line":48},[45,1062,230],{"class":51},[45,1064,56],{"class":55},[45,1066,1067],{"class":582}," 5\n",[45,1069,1070,1072,1074,1076,1078],{"class":47,"line":70},[45,1071,230],{"class":51},[45,1073,56],{"class":55},[45,1075,60],{"class":59},[45,1077,64],{"class":63},[45,1079,67],{"class":59},[45,1081,1082],{"class":47,"line":93},[45,1083,97],{"emptyLinePlaceholder":96},[45,1085,1086,1088,1090,1092,1094,1096,1098],{"class":47,"line":100},[45,1087,104],{"class":103},[45,1089,107],{"class":51},[45,1091,110],{"class":103},[45,1093,114],{"class":113},[45,1095,83],{"class":82},[45,1097,258],{"class":86},[45,1099,122],{"class":82},[45,1101,1102,1104,1106,1108],{"class":47,"line":125},[45,1103,128],{"class":113},[45,1105,83],{"class":82},[45,1107,133],{"class":86},[45,1109,90],{"class":82},[20,1111,1112,1113,1115],{},"The second assignment changes ",[15,1114,258],{}," from an integer to a string.",[31,1117,1119],{"id":1118},"faq","FAQ",[605,1121,1123,1124,1126],{"id":1122},"why-does-input-cause-this-error-so-often","Why does ",[15,1125,207],{}," cause this error so often?",[20,1128,1129,1130,1134,1135,1138],{},"Because ",[173,1131,1132],{"href":204},[15,1133,207],{}," always returns a string. You usually need ",[15,1136,1137],{},"int(input(...))"," when asking for a whole number.",[605,1140,1142],{"id":1141},"what-is-the-difference-between-a-string-and-an-integer","What is the difference between a string and an integer?",[20,1144,1145],{},"A string is text, even if it looks like a number. An integer is a whole number value Python can use in numeric operations.",[605,1147,1149,1150,1152,1153,1155],{"id":1148},"should-i-use-int-or-float","Should I use ",[15,1151,507],{}," or ",[15,1154,781],{},"?",[20,1157,1158,1159,1161,1162,1164,1165,1167,1168,422],{},"Use ",[15,1160,507],{}," for whole numbers like ",[15,1163,64],{},". Use ",[15,1166,781],{}," for decimal numbers like ",[15,1169,1170],{},"5.2",[605,1172,1123,1174,1176,1177,1155],{"id":1173},"why-does-5-not-work-the-same-as-5",[15,1175,296],{}," not work the same as ",[15,1178,64],{},[20,1180,1129,1181,1183],{},[15,1182,296],{}," is text inside quotes. Python treats it as a string, not a number.",[605,1185,1187],{"id":1186},"can-i-fix-this-with-type-checking-first","Can I fix this with type checking first?",[20,1189,1190,1191,1152,1193,1196],{},"Yes. You can inspect the value with ",[15,1192,688],{},[15,1194,1195],{},"isinstance()"," before using it where an integer is required.",[31,1198,1200],{"id":1199},"see-also","See also",[147,1202,1203,1211,1216,1222,1228,1232],{},[150,1204,1205],{},[173,1206,1207,1208,1210],{"href":504},"Python ",[15,1209,507],{}," function explained",[150,1212,1213],{},[173,1214,1215],{"href":700},"How to convert a string to int in Python",[150,1217,1218],{},[173,1219,1207,1220,1210],{"href":204},[15,1221,207],{},[150,1223,1224],{},[173,1225,1207,1226,1210],{"href":175},[15,1227,178],{},[150,1229,1230],{},[173,1231,789],{"href":788},[150,1233,1234],{},[173,1235,13,1237],{"href":1236},"\u002Ferrors\u002Ftypeerror-float-object-cannot-be-interpreted-as-an-integer-fix",[15,1238,1239],{},"'float' object cannot be interpreted as an integer",[1241,1242,1243],"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 .sZMiF, html code.shiki .sZMiF{--shiki-light:#E2931D;--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 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 .sptTA, html code.shiki .sptTA{--shiki-light:#6182B8;--shiki-default:#005CC5;--shiki-dark:#79B8FF}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 .sutJx, html code.shiki .sutJx{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#6A737D;--shiki-default-font-style:inherit;--shiki-dark:#6A737D;--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 .srdBf, html code.shiki .srdBf{--shiki-light:#F76D47;--shiki-default:#005CC5;--shiki-dark:#79B8FF}",{"title":41,"searchDepth":70,"depth":70,"links":1245},[1246,1247,1248,1249,1250,1251,1255,1257,1261,1262,1272],{"id":33,"depth":70,"text":34},{"id":141,"depth":70,"text":142},{"id":190,"depth":70,"text":191},{"id":300,"depth":70,"text":301},{"id":412,"depth":70,"text":413},{"id":497,"depth":70,"text":498,"children":1252},[1253,1254],{"id":607,"depth":93,"text":608},{"id":674,"depth":93,"text":675},{"id":704,"depth":70,"text":1256},"If int() also fails",{"id":792,"depth":70,"text":793,"children":1258},[1259,1260],{"id":866,"depth":93,"text":867},{"id":896,"depth":93,"text":897},{"id":1025,"depth":70,"text":1026},{"id":1118,"depth":70,"text":1119,"children":1263},[1264,1266,1267,1269,1271],{"id":1122,"depth":93,"text":1265},"Why does input() cause this error so often?",{"id":1141,"depth":93,"text":1142},{"id":1148,"depth":93,"text":1268},"Should I use int() or float()?",{"id":1173,"depth":93,"text":1270},"Why does \"5\" not work the same as 5?",{"id":1186,"depth":93,"text":1187},{"id":1199,"depth":70,"text":1200},"Master typeerror str object cannot be interpreted as an integer fix in our comprehensive Python beginner guide.","md",{},"\u002Ferrors\u002Ftypeerror-str-object-cannot-be-interpreted-as-an-integer-fix",{"title":5,"description":1273},"errors\u002Ftypeerror-str-object-cannot-be-interpreted-as-an-integer-fix","LTYZZ29TNQ-_-11__UQUAAE3nW2dIe7nFSGgxdxIx1g",1777585507580]