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