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