[{"data":1,"prerenderedAt":2163},["ShallowReactive",2],{"doc-\u002Flearn\u002Fwhen-to-use-lists-vs-tuples-vs-sets-vs-dictionaries":3},{"id":4,"title":5,"body":6,"description":2156,"extension":2157,"meta":2158,"navigation":436,"path":2159,"seo":2160,"stem":2161,"__hash__":2162},"content\u002Flearn\u002Fwhen-to-use-lists-vs-tuples-vs-sets-vs-dictionaries.md","When to Use Lists vs Tuples vs Sets vs Dictionaries",{"type":7,"value":8,"toc":2130},"minimark",[9,13,17,20,49,52,57,234,253,257,260,271,275,278,304,307,490,493,590,593,615,619,622,625,647,650,664,762,765,806,813,817,820,823,837,840,922,924,939,942,945,981,993,997,1000,1003,1014,1017,1028,1154,1156,1200,1203,1215,1219,1222,1225,1242,1245,1355,1357,1372,1375,1378,1397,1400,1416,1428,1432,1435,1457,1460,1514,1518,1521,1526,1579,1582,1586,1635,1638,1642,1702,1705,1709,1802,1805,1809,1812,1826,1829,1843,1846,1982,1985,1999,2003,2009,2012,2034,2037,2041,2045,2048,2052,2055,2059,2070,2074,2077,2081,2084,2088,2126],[10,11,5],"h1",{"id":12},"when-to-use-lists-vs-tuples-vs-sets-vs-dictionaries",[14,15,16],"p",{},"Choosing the right Python collection type is easier when you focus on how the data will be used.",[14,18,19],{},"This page helps you decide between:",[21,22,23,31,37,43],"ul",{},[24,25,26,30],"li",{},[27,28,29],"strong",{},"lists"," for ordered items you may change",[24,32,33,36],{},[27,34,35],{},"tuples"," for ordered data that should stay fixed",[24,38,39,42],{},[27,40,41],{},"sets"," for unique values",[24,44,45,48],{},[27,46,47],{},"dictionaries"," for key-value pairs",[14,50,51],{},"If you are new to Python, it is common to use a list for everything at first. But Python gives you different collection types because they solve different problems.",[53,54,56],"h2",{"id":55},"quick-answer","Quick answer",[58,59,64],"pre",{"className":60,"code":61,"language":62,"meta":63,"style":63},"language-python shiki shiki-themes material-theme-lighter github-light github-dark","shopping_list = [\"milk\", \"eggs\", \"bread\"]      # list: ordered, changeable\npoint = (10, 20)                                # tuple: ordered, not meant to change\nunique_tags = {\"python\", \"beginner\", \"tips\"}   # set: unique items, no duplicates\nuser = {\"name\": \"Ana\", \"age\": 25}              # dictionary: key-value pairs\n","python","",[65,66,67,121,147,188],"code",{"__ignoreMap":63},[68,69,72,76,80,84,88,92,94,97,100,103,105,107,109,112,114,117],"span",{"class":70,"line":71},"line",1,[68,73,75],{"class":74},"su5hD","shopping_list ",[68,77,79],{"class":78},"smGrS","=",[68,81,83],{"class":82},"sP7_E"," [",[68,85,87],{"class":86},"sjJ54","\"",[68,89,91],{"class":90},"s_sjI","milk",[68,93,87],{"class":86},[68,95,96],{"class":82},",",[68,98,99],{"class":86}," \"",[68,101,102],{"class":90},"eggs",[68,104,87],{"class":86},[68,106,96],{"class":82},[68,108,99],{"class":86},[68,110,111],{"class":90},"bread",[68,113,87],{"class":86},[68,115,116],{"class":82},"]",[68,118,120],{"class":119},"sutJx","      # list: ordered, changeable\n",[68,122,124,127,129,132,136,138,141,144],{"class":70,"line":123},2,[68,125,126],{"class":74},"point ",[68,128,79],{"class":78},[68,130,131],{"class":82}," (",[68,133,135],{"class":134},"srdBf","10",[68,137,96],{"class":82},[68,139,140],{"class":134}," 20",[68,142,143],{"class":82},")",[68,145,146],{"class":119},"                                # tuple: ordered, not meant to change\n",[68,148,150,153,155,158,160,162,164,166,168,171,173,175,177,180,182,185],{"class":70,"line":149},3,[68,151,152],{"class":74},"unique_tags ",[68,154,79],{"class":78},[68,156,157],{"class":82}," {",[68,159,87],{"class":86},[68,161,62],{"class":90},[68,163,87],{"class":86},[68,165,96],{"class":82},[68,167,99],{"class":86},[68,169,170],{"class":90},"beginner",[68,172,87],{"class":86},[68,174,96],{"class":82},[68,176,99],{"class":86},[68,178,179],{"class":90},"tips",[68,181,87],{"class":86},[68,183,184],{"class":82},"}",[68,186,187],{"class":119},"   # set: unique items, no duplicates\n",[68,189,191,194,196,198,200,203,205,208,210,213,215,217,219,222,224,226,229,231],{"class":70,"line":190},4,[68,192,193],{"class":74},"user ",[68,195,79],{"class":78},[68,197,157],{"class":82},[68,199,87],{"class":86},[68,201,202],{"class":90},"name",[68,204,87],{"class":86},[68,206,207],{"class":82},":",[68,209,99],{"class":86},[68,211,212],{"class":90},"Ana",[68,214,87],{"class":86},[68,216,96],{"class":82},[68,218,99],{"class":86},[68,220,221],{"class":90},"age",[68,223,87],{"class":86},[68,225,207],{"class":82},[68,227,228],{"class":134}," 25",[68,230,184],{"class":82},[68,232,233],{"class":119},"              # dictionary: key-value pairs\n",[14,235,236,237,240,241,244,245,248,249,252],{},"Use a ",[27,238,239],{},"list"," for a sequence, a ",[27,242,243],{},"tuple"," for fixed data, a ",[27,246,247],{},"set"," for unique values, and a ",[27,250,251],{},"dictionary"," for named values.",[53,254,256],{"id":255},"what-this-page-helps-you-decide","What this page helps you decide",[14,258,259],{},"This page will help you:",[21,261,262,265,268],{},[24,263,264],{},"Choose the right collection type for a beginner-level problem",[24,266,267],{},"Compare list, tuple, set, and dictionary by use case",[24,269,270],{},"Avoid guessing based only on syntax",[53,272,274],{"id":273},"quick-comparison-list-vs-tuple-vs-set-vs-dictionary","Quick comparison: list vs tuple vs set vs dictionary",[14,276,277],{},"Here is the simplest way to compare them:",[21,279,280,286,292,298],{},[24,281,282,285],{},[27,283,284],{},"List",": ordered, changeable, allows duplicates",[24,287,288,291],{},[27,289,290],{},"Tuple",": ordered, usually used for fixed data, allows duplicates",[24,293,294,297],{},[27,295,296],{},"Set",": unordered, changeable, no duplicate values",[24,299,300,303],{},[27,301,302],{},"Dictionary",": key-value pairs, changeable, keys must be unique",[14,305,306],{},"You can also see the difference in code:",[58,308,310],{"className":60,"code":309,"language":62,"meta":63,"style":63},"numbers_list = [1, 2, 2, 3]\nnumbers_tuple = (1, 2, 2, 3)\nnumbers_set = {1, 2, 2, 3}\nuser = {\"name\": \"Sam\", \"age\": 30}\n\nprint(numbers_list)\nprint(numbers_tuple)\nprint(numbers_set)\nprint(user)\n",[65,311,312,341,367,393,431,438,454,466,478],{"__ignoreMap":63},[68,313,314,317,319,321,324,326,329,331,333,335,338],{"class":70,"line":71},[68,315,316],{"class":74},"numbers_list ",[68,318,79],{"class":78},[68,320,83],{"class":82},[68,322,323],{"class":134},"1",[68,325,96],{"class":82},[68,327,328],{"class":134}," 2",[68,330,96],{"class":82},[68,332,328],{"class":134},[68,334,96],{"class":82},[68,336,337],{"class":134}," 3",[68,339,340],{"class":82},"]\n",[68,342,343,346,348,350,352,354,356,358,360,362,364],{"class":70,"line":123},[68,344,345],{"class":74},"numbers_tuple ",[68,347,79],{"class":78},[68,349,131],{"class":82},[68,351,323],{"class":134},[68,353,96],{"class":82},[68,355,328],{"class":134},[68,357,96],{"class":82},[68,359,328],{"class":134},[68,361,96],{"class":82},[68,363,337],{"class":134},[68,365,366],{"class":82},")\n",[68,368,369,372,374,376,378,380,382,384,386,388,390],{"class":70,"line":149},[68,370,371],{"class":74},"numbers_set ",[68,373,79],{"class":78},[68,375,157],{"class":82},[68,377,323],{"class":134},[68,379,96],{"class":82},[68,381,328],{"class":134},[68,383,96],{"class":82},[68,385,328],{"class":134},[68,387,96],{"class":82},[68,389,337],{"class":134},[68,391,392],{"class":82},"}\n",[68,394,395,397,399,401,403,405,407,409,411,414,416,418,420,422,424,426,429],{"class":70,"line":190},[68,396,193],{"class":74},[68,398,79],{"class":78},[68,400,157],{"class":82},[68,402,87],{"class":86},[68,404,202],{"class":90},[68,406,87],{"class":86},[68,408,207],{"class":82},[68,410,99],{"class":86},[68,412,413],{"class":90},"Sam",[68,415,87],{"class":86},[68,417,96],{"class":82},[68,419,99],{"class":86},[68,421,221],{"class":90},[68,423,87],{"class":86},[68,425,207],{"class":82},[68,427,428],{"class":134}," 30",[68,430,392],{"class":82},[68,432,434],{"class":70,"line":433},5,[68,435,437],{"emptyLinePlaceholder":436},true,"\n",[68,439,441,445,448,452],{"class":70,"line":440},6,[68,442,444],{"class":443},"sptTA","print",[68,446,447],{"class":82},"(",[68,449,451],{"class":450},"slqww","numbers_list",[68,453,366],{"class":82},[68,455,457,459,461,464],{"class":70,"line":456},7,[68,458,444],{"class":443},[68,460,447],{"class":82},[68,462,463],{"class":450},"numbers_tuple",[68,465,366],{"class":82},[68,467,469,471,473,476],{"class":70,"line":468},8,[68,470,444],{"class":443},[68,472,447],{"class":82},[68,474,475],{"class":450},"numbers_set",[68,477,366],{"class":82},[68,479,481,483,485,488],{"class":70,"line":480},9,[68,482,444],{"class":443},[68,484,447],{"class":82},[68,486,487],{"class":450},"user",[68,489,366],{"class":82},[14,491,492],{},"Possible output:",[58,494,496],{"className":60,"code":495,"language":62,"meta":63,"style":63},"[1, 2, 2, 3]\n(1, 2, 2, 3)\n{1, 2, 3}\n{'name': 'Sam', 'age': 30}\n",[65,497,498,519,539,556],{"__ignoreMap":63},[68,499,500,503,505,507,509,511,513,515,517],{"class":70,"line":71},[68,501,502],{"class":82},"[",[68,504,323],{"class":134},[68,506,96],{"class":82},[68,508,328],{"class":134},[68,510,96],{"class":82},[68,512,328],{"class":134},[68,514,96],{"class":82},[68,516,337],{"class":134},[68,518,340],{"class":82},[68,520,521,523,525,527,529,531,533,535,537],{"class":70,"line":123},[68,522,447],{"class":82},[68,524,323],{"class":134},[68,526,96],{"class":82},[68,528,328],{"class":134},[68,530,96],{"class":82},[68,532,328],{"class":134},[68,534,96],{"class":82},[68,536,337],{"class":134},[68,538,366],{"class":82},[68,540,541,544,546,548,550,552,554],{"class":70,"line":149},[68,542,543],{"class":82},"{",[68,545,323],{"class":134},[68,547,96],{"class":82},[68,549,328],{"class":134},[68,551,96],{"class":82},[68,553,337],{"class":134},[68,555,392],{"class":82},[68,557,558,560,563,565,567,569,572,574,576,578,580,582,584,586,588],{"class":70,"line":190},[68,559,543],{"class":82},[68,561,562],{"class":86},"'",[68,564,202],{"class":90},[68,566,562],{"class":86},[68,568,207],{"class":82},[68,570,571],{"class":86}," '",[68,573,413],{"class":90},[68,575,562],{"class":86},[68,577,96],{"class":82},[68,579,571],{"class":86},[68,581,221],{"class":90},[68,583,562],{"class":86},[68,585,207],{"class":82},[68,587,428],{"class":134},[68,589,392],{"class":82},[14,591,592],{},"Notice:",[21,594,595,601,605,610],{},[24,596,597,598,600],{},"The ",[27,599,239],{}," keeps order and duplicates",[24,602,597,603,600],{},[27,604,243],{},[24,606,597,607,609],{},[27,608,247],{}," removes duplicates",[24,611,597,612,614],{},[27,613,251],{}," stores values with names",[53,616,618],{"id":617},"use-a-list-when-order-matters-and-you-may-change-the-data","Use a list when order matters and you may change the data",[14,620,621],{},"Use a list when you have a sequence of items and you may add, remove, or change them later.",[14,623,624],{},"A list is best when:",[21,626,627,630,633,644],{},[24,628,629],{},"Order matters",[24,631,632],{},"You want to access items by position",[24,634,635,636],{},"You may need methods like ",[637,638,640,643],"a",{"href":639},"\u002Freference\u002Fpython-list-append-method\u002F",[65,641,642],{},"append()"," for lists",[24,645,646],{},"Duplicates are allowed",[14,648,649],{},"Common examples:",[21,651,652,655,658,661],{},[24,653,654],{},"To-do items",[24,656,657],{},"Names",[24,659,660],{},"Scores",[24,662,663],{},"Lines from a file",[58,665,667],{"className":60,"code":666,"language":62,"meta":63,"style":63},"shopping_list = [\"milk\", \"eggs\", \"bread\"]\n\nshopping_list.append(\"butter\")\nshopping_list[1] = \"cheese\"\n\nprint(shopping_list)\n",[65,668,669,701,705,727,748,752],{"__ignoreMap":63},[68,670,671,673,675,677,679,681,683,685,687,689,691,693,695,697,699],{"class":70,"line":71},[68,672,75],{"class":74},[68,674,79],{"class":78},[68,676,83],{"class":82},[68,678,87],{"class":86},[68,680,91],{"class":90},[68,682,87],{"class":86},[68,684,96],{"class":82},[68,686,99],{"class":86},[68,688,102],{"class":90},[68,690,87],{"class":86},[68,692,96],{"class":82},[68,694,99],{"class":86},[68,696,111],{"class":90},[68,698,87],{"class":86},[68,700,340],{"class":82},[68,702,703],{"class":70,"line":123},[68,704,437],{"emptyLinePlaceholder":436},[68,706,707,710,713,716,718,720,723,725],{"class":70,"line":149},[68,708,709],{"class":74},"shopping_list",[68,711,712],{"class":82},".",[68,714,715],{"class":450},"append",[68,717,447],{"class":82},[68,719,87],{"class":86},[68,721,722],{"class":90},"butter",[68,724,87],{"class":86},[68,726,366],{"class":82},[68,728,729,731,733,735,737,740,742,745],{"class":70,"line":190},[68,730,709],{"class":74},[68,732,502],{"class":82},[68,734,323],{"class":134},[68,736,116],{"class":82},[68,738,739],{"class":78}," =",[68,741,99],{"class":86},[68,743,744],{"class":90},"cheese",[68,746,747],{"class":86},"\"\n",[68,749,750],{"class":70,"line":433},[68,751,437],{"emptyLinePlaceholder":436},[68,753,754,756,758,760],{"class":70,"line":440},[68,755,444],{"class":443},[68,757,447],{"class":82},[68,759,709],{"class":450},[68,761,366],{"class":82},[14,763,764],{},"Output:",[58,766,768],{"className":60,"code":767,"language":62,"meta":63,"style":63},"['milk', 'cheese', 'bread', 'butter']\n",[65,769,770],{"__ignoreMap":63},[68,771,772,774,776,778,780,782,784,786,788,790,792,794,796,798,800,802,804],{"class":70,"line":71},[68,773,502],{"class":82},[68,775,562],{"class":86},[68,777,91],{"class":90},[68,779,562],{"class":86},[68,781,96],{"class":82},[68,783,571],{"class":86},[68,785,744],{"class":90},[68,787,562],{"class":86},[68,789,96],{"class":82},[68,791,571],{"class":86},[68,793,111],{"class":90},[68,795,562],{"class":86},[68,797,96],{"class":82},[68,799,571],{"class":86},[68,801,722],{"class":90},[68,803,562],{"class":86},[68,805,340],{"class":82},[14,807,808,809,712],{},"A list is usually the right choice for general ordered data. If you want a full beginner guide, see ",[637,810,812],{"href":811},"\u002Flearn\u002Fpython-lists-explained-beginner-guide\u002F","Python lists explained",[53,814,816],{"id":815},"use-a-tuple-when-the-data-should-stay-fixed","Use a tuple when the data should stay fixed",[14,818,819],{},"Use a tuple when values belong together and should not be changed often.",[14,821,822],{},"A tuple is good for:",[21,824,825,828,831,834],{},[24,826,827],{},"Coordinates",[24,829,830],{},"RGB color values",[24,832,833],{},"Dates",[24,835,836],{},"Returning multiple values from a function",[14,838,839],{},"Like a list, a tuple is ordered. You can still read items by index.",[58,841,843],{"className":60,"code":842,"language":62,"meta":63,"style":63},"point = (10, 20)\ncolor = (255, 100, 50)\n\nprint(point[0])\nprint(color[2])\n",[65,844,845,861,885,889,906],{"__ignoreMap":63},[68,846,847,849,851,853,855,857,859],{"class":70,"line":71},[68,848,126],{"class":74},[68,850,79],{"class":78},[68,852,131],{"class":82},[68,854,135],{"class":134},[68,856,96],{"class":82},[68,858,140],{"class":134},[68,860,366],{"class":82},[68,862,863,866,868,870,873,875,878,880,883],{"class":70,"line":123},[68,864,865],{"class":74},"color ",[68,867,79],{"class":78},[68,869,131],{"class":82},[68,871,872],{"class":134},"255",[68,874,96],{"class":82},[68,876,877],{"class":134}," 100",[68,879,96],{"class":82},[68,881,882],{"class":134}," 50",[68,884,366],{"class":82},[68,886,887],{"class":70,"line":149},[68,888,437],{"emptyLinePlaceholder":436},[68,890,891,893,895,898,900,903],{"class":70,"line":190},[68,892,444],{"class":443},[68,894,447],{"class":82},[68,896,897],{"class":450},"point",[68,899,502],{"class":82},[68,901,902],{"class":134},"0",[68,904,905],{"class":82},"])\n",[68,907,908,910,912,915,917,920],{"class":70,"line":433},[68,909,444],{"class":443},[68,911,447],{"class":82},[68,913,914],{"class":450},"color",[68,916,502],{"class":82},[68,918,919],{"class":134},"2",[68,921,905],{"class":82},[14,923,764],{},[58,925,927],{"className":60,"code":926,"language":62,"meta":63,"style":63},"10\n50\n",[65,928,929,934],{"__ignoreMap":63},[68,930,931],{"class":70,"line":71},[68,932,933],{"class":134},"10\n",[68,935,936],{"class":70,"line":123},[68,937,938],{"class":134},"50\n",[14,940,941],{},"The main idea is not just syntax. It is meaning. A tuple tells readers, “this data is fixed.”",[14,943,944],{},"If you try to change a tuple item, Python raises an error:",[58,946,948],{"className":60,"code":947,"language":62,"meta":63,"style":63},"point = (10, 20)\npoint[0] = 99\n",[65,949,950,966],{"__ignoreMap":63},[68,951,952,954,956,958,960,962,964],{"class":70,"line":71},[68,953,126],{"class":74},[68,955,79],{"class":78},[68,957,131],{"class":82},[68,959,135],{"class":134},[68,961,96],{"class":82},[68,963,140],{"class":134},[68,965,366],{"class":82},[68,967,968,970,972,974,976,978],{"class":70,"line":123},[68,969,897],{"class":74},[68,971,502],{"class":82},[68,973,902],{"class":134},[68,975,116],{"class":82},[68,977,739],{"class":78},[68,979,980],{"class":134}," 99\n",[14,982,983,984,988,989,712],{},"You can learn more in ",[637,985,987],{"href":986},"\u002Flearn\u002Fpython-tuples-explained\u002F","Python tuples explained"," and ",[637,990,992],{"href":991},"\u002Flearn\u002Fmutability-in-python-explained-mutable-vs-immutable-types\u002F","mutability in Python",[53,994,996],{"id":995},"use-a-set-when-you-only-care-about-unique-values","Use a set when you only care about unique values",[14,998,999],{},"Use a set when duplicates should be removed or when you only care whether a value exists.",[14,1001,1002],{},"A set is best for:",[21,1004,1005,1008,1011],{},[24,1006,1007],{},"Removing duplicates",[24,1009,1010],{},"Fast membership checks",[24,1012,1013],{},"Keeping unique categories, tags, or IDs",[14,1015,1016],{},"Do not use a set if you need:",[21,1018,1019,1022],{},[24,1020,1021],{},"Item order",[24,1023,1024,1025],{},"Indexing like ",[65,1026,1027],{},"items[0]",[58,1029,1031],{"className":60,"code":1030,"language":62,"meta":63,"style":63},"tags = [\"python\", \"beginner\", \"python\", \"tips\", \"tips\"]\nunique_tags = set(tags)\n\nprint(unique_tags)\nprint(\"python\" in unique_tags)\nprint(\"java\" in unique_tags)\n",[65,1032,1033,1082,1099,1103,1114,1135],{"__ignoreMap":63},[68,1034,1035,1038,1040,1042,1044,1046,1048,1050,1052,1054,1056,1058,1060,1062,1064,1066,1068,1070,1072,1074,1076,1078,1080],{"class":70,"line":71},[68,1036,1037],{"class":74},"tags ",[68,1039,79],{"class":78},[68,1041,83],{"class":82},[68,1043,87],{"class":86},[68,1045,62],{"class":90},[68,1047,87],{"class":86},[68,1049,96],{"class":82},[68,1051,99],{"class":86},[68,1053,170],{"class":90},[68,1055,87],{"class":86},[68,1057,96],{"class":82},[68,1059,99],{"class":86},[68,1061,62],{"class":90},[68,1063,87],{"class":86},[68,1065,96],{"class":82},[68,1067,99],{"class":86},[68,1069,179],{"class":90},[68,1071,87],{"class":86},[68,1073,96],{"class":82},[68,1075,99],{"class":86},[68,1077,179],{"class":90},[68,1079,87],{"class":86},[68,1081,340],{"class":82},[68,1083,1084,1086,1088,1092,1094,1097],{"class":70,"line":123},[68,1085,152],{"class":74},[68,1087,79],{"class":78},[68,1089,1091],{"class":1090},"sZMiF"," set",[68,1093,447],{"class":82},[68,1095,1096],{"class":450},"tags",[68,1098,366],{"class":82},[68,1100,1101],{"class":70,"line":149},[68,1102,437],{"emptyLinePlaceholder":436},[68,1104,1105,1107,1109,1112],{"class":70,"line":190},[68,1106,444],{"class":443},[68,1108,447],{"class":82},[68,1110,1111],{"class":450},"unique_tags",[68,1113,366],{"class":82},[68,1115,1116,1118,1120,1122,1124,1126,1130,1133],{"class":70,"line":433},[68,1117,444],{"class":443},[68,1119,447],{"class":82},[68,1121,87],{"class":86},[68,1123,62],{"class":90},[68,1125,87],{"class":86},[68,1127,1129],{"class":1128},"sVHd0"," in",[68,1131,1132],{"class":450}," unique_tags",[68,1134,366],{"class":82},[68,1136,1137,1139,1141,1143,1146,1148,1150,1152],{"class":70,"line":440},[68,1138,444],{"class":443},[68,1140,447],{"class":82},[68,1142,87],{"class":86},[68,1144,1145],{"class":90},"java",[68,1147,87],{"class":86},[68,1149,1129],{"class":1128},[68,1151,1132],{"class":450},[68,1153,366],{"class":82},[14,1155,492],{},[58,1157,1159],{"className":60,"code":1158,"language":62,"meta":63,"style":63},"{'python', 'beginner', 'tips'}\nTrue\nFalse\n",[65,1160,1161,1189,1195],{"__ignoreMap":63},[68,1162,1163,1165,1167,1169,1171,1173,1175,1177,1179,1181,1183,1185,1187],{"class":70,"line":71},[68,1164,543],{"class":82},[68,1166,562],{"class":86},[68,1168,62],{"class":90},[68,1170,562],{"class":86},[68,1172,96],{"class":82},[68,1174,571],{"class":86},[68,1176,170],{"class":90},[68,1178,562],{"class":86},[68,1180,96],{"class":82},[68,1182,571],{"class":86},[68,1184,179],{"class":90},[68,1186,562],{"class":86},[68,1188,392],{"class":82},[68,1190,1191],{"class":70,"line":123},[68,1192,1194],{"class":1193},"s39Yj","True\n",[68,1196,1197],{"class":70,"line":149},[68,1198,1199],{"class":1193},"False\n",[14,1201,1202],{},"The exact order of set output can vary.",[14,1204,1205,1206,1210,1211,712],{},"If your goal is specifically to remove duplicates from a list, see ",[637,1207,1209],{"href":1208},"\u002Fhow-to\u002Fhow-to-remove-duplicates-from-a-list-in-python\u002F","how to remove duplicates from a list in Python",". For a full overview, read ",[637,1212,1214],{"href":1213},"\u002Flearn\u002Fpython-sets-explained\u002F","Python sets explained",[53,1216,1218],{"id":1217},"use-a-dictionary-when-values-have-names","Use a dictionary when values have names",[14,1220,1221],{},"Use a dictionary when each piece of data has a label.",[14,1223,1224],{},"A dictionary is best for:",[21,1226,1227,1230,1233,1236,1239],{},[24,1228,1229],{},"User data",[24,1231,1232],{},"Settings",[24,1234,1235],{},"API responses",[24,1237,1238],{},"Counting words",[24,1240,1241],{},"Any data where a key describes a value",[14,1243,1244],{},"This is often clearer than using a list and trying to remember positions.",[58,1246,1248],{"className":60,"code":1247,"language":62,"meta":63,"style":63},"user = {\n    \"name\": \"Ana\",\n    \"age\": 25,\n    \"email\": \"ana@example.com\"\n}\n\nprint(user[\"name\"])\nprint(user[\"age\"])\n",[65,1249,1250,1259,1279,1293,1311,1315,1319,1337],{"__ignoreMap":63},[68,1251,1252,1254,1256],{"class":70,"line":71},[68,1253,193],{"class":74},[68,1255,79],{"class":78},[68,1257,1258],{"class":82}," {\n",[68,1260,1261,1264,1266,1268,1270,1272,1274,1276],{"class":70,"line":123},[68,1262,1263],{"class":86},"    \"",[68,1265,202],{"class":90},[68,1267,87],{"class":86},[68,1269,207],{"class":82},[68,1271,99],{"class":86},[68,1273,212],{"class":90},[68,1275,87],{"class":86},[68,1277,1278],{"class":82},",\n",[68,1280,1281,1283,1285,1287,1289,1291],{"class":70,"line":149},[68,1282,1263],{"class":86},[68,1284,221],{"class":90},[68,1286,87],{"class":86},[68,1288,207],{"class":82},[68,1290,228],{"class":134},[68,1292,1278],{"class":82},[68,1294,1295,1297,1300,1302,1304,1306,1309],{"class":70,"line":190},[68,1296,1263],{"class":86},[68,1298,1299],{"class":90},"email",[68,1301,87],{"class":86},[68,1303,207],{"class":82},[68,1305,99],{"class":86},[68,1307,1308],{"class":90},"ana@example.com",[68,1310,747],{"class":86},[68,1312,1313],{"class":70,"line":433},[68,1314,392],{"class":82},[68,1316,1317],{"class":70,"line":440},[68,1318,437],{"emptyLinePlaceholder":436},[68,1320,1321,1323,1325,1327,1329,1331,1333,1335],{"class":70,"line":456},[68,1322,444],{"class":443},[68,1324,447],{"class":82},[68,1326,487],{"class":450},[68,1328,502],{"class":82},[68,1330,87],{"class":86},[68,1332,202],{"class":90},[68,1334,87],{"class":86},[68,1336,905],{"class":82},[68,1338,1339,1341,1343,1345,1347,1349,1351,1353],{"class":70,"line":468},[68,1340,444],{"class":443},[68,1342,447],{"class":82},[68,1344,487],{"class":450},[68,1346,502],{"class":82},[68,1348,87],{"class":86},[68,1350,221],{"class":90},[68,1352,87],{"class":86},[68,1354,905],{"class":82},[14,1356,764],{},[58,1358,1360],{"className":60,"code":1359,"language":62,"meta":63,"style":63},"Ana\n25\n",[65,1361,1362,1367],{"__ignoreMap":63},[68,1363,1364],{"class":70,"line":71},[68,1365,1366],{"class":74},"Ana\n",[68,1368,1369],{"class":70,"line":123},[68,1370,1371],{"class":134},"25\n",[14,1373,1374],{},"A dictionary lets you access values by key instead of by position.",[14,1376,1377],{},"That means this:",[58,1379,1381],{"className":60,"code":1380,"language":62,"meta":63,"style":63},"user[\"email\"]\n",[65,1382,1383],{"__ignoreMap":63},[68,1384,1385,1387,1389,1391,1393,1395],{"class":70,"line":71},[68,1386,487],{"class":74},[68,1388,502],{"class":82},[68,1390,87],{"class":86},[68,1392,1299],{"class":90},[68,1394,87],{"class":86},[68,1396,340],{"class":82},[14,1398,1399],{},"is usually clearer than something like this:",[58,1401,1403],{"className":60,"code":1402,"language":62,"meta":63,"style":63},"user_data[2]\n",[65,1404,1405],{"__ignoreMap":63},[68,1406,1407,1410,1412,1414],{"class":70,"line":71},[68,1408,1409],{"class":74},"user_data",[68,1411,502],{"class":82},[68,1413,919],{"class":134},[68,1415,340],{"class":82},[14,1417,1418,1419,1423,1424,712],{},"If you want to go deeper, read ",[637,1420,1422],{"href":1421},"\u002Flearn\u002Fpython-dictionaries-explained\u002F","Python dictionaries explained"," or ",[637,1425,1427],{"href":1426},"\u002Fhow-to\u002Fhow-to-check-if-a-key-exists-in-a-dictionary-in-python\u002F","how to check if a key exists in a dictionary in Python",[53,1429,1431],{"id":1430},"simple-decision-checklist","Simple decision checklist",[14,1433,1434],{},"Use this quick checklist when choosing a type:",[21,1436,1437,1442,1447,1452],{},[24,1438,1439,1440],{},"Need key-value pairs? Use a ",[27,1441,251],{},[24,1443,1444,1445],{},"Need unique items only? Use a ",[27,1446,247],{},[24,1448,1449,1450],{},"Need ordered items you may change? Use a ",[27,1451,239],{},[24,1453,1454,1455],{},"Need ordered items that should stay fixed? Use a ",[27,1456,243],{},[14,1458,1459],{},"Another way to think about it:",[1461,1462,1463,1479,1488,1499],"ol",{},[24,1464,1465,1466,1423,1469,1472,1473],{},"Does each value have a name like ",[65,1467,1468],{},"\"name\"",[65,1470,1471],{},"\"age\"","?\n",[21,1474,1475],{},[24,1476,236,1477],{},[27,1478,251],{},[24,1480,1481,1482],{},"Do you only care about unique values?\n",[21,1483,1484],{},[24,1485,236,1486],{},[27,1487,247],{},[24,1489,1490,1491],{},"Do you need an ordered sequence?\n",[21,1492,1493],{},[24,1494,236,1495,1423,1497],{},[27,1496,239],{},[27,1498,243],{},[24,1500,1501,1502],{},"Will the sequence change?\n",[21,1503,1504,1509],{},[24,1505,236,1506,1508],{},[27,1507,239],{}," if yes",[24,1510,236,1511,1513],{},[27,1512,243],{}," if no",[53,1515,1517],{"id":1516},"beginner-examples-of-the-same-data-in-different-structures","Beginner examples of the same data in different structures",[14,1519,1520],{},"Here are simple examples of real beginner-level data.",[1522,1523,1525],"h3",{"id":1524},"shopping-items-as-a-list","Shopping items as a list",[58,1527,1529],{"className":60,"code":1528,"language":62,"meta":63,"style":63},"shopping_items = [\"milk\", \"eggs\", \"bread\"]\nprint(shopping_items[0])\n",[65,1530,1531,1564],{"__ignoreMap":63},[68,1532,1533,1536,1538,1540,1542,1544,1546,1548,1550,1552,1554,1556,1558,1560,1562],{"class":70,"line":71},[68,1534,1535],{"class":74},"shopping_items ",[68,1537,79],{"class":78},[68,1539,83],{"class":82},[68,1541,87],{"class":86},[68,1543,91],{"class":90},[68,1545,87],{"class":86},[68,1547,96],{"class":82},[68,1549,99],{"class":86},[68,1551,102],{"class":90},[68,1553,87],{"class":86},[68,1555,96],{"class":82},[68,1557,99],{"class":86},[68,1559,111],{"class":90},[68,1561,87],{"class":86},[68,1563,340],{"class":82},[68,1565,1566,1568,1570,1573,1575,1577],{"class":70,"line":123},[68,1567,444],{"class":443},[68,1569,447],{"class":82},[68,1571,1572],{"class":450},"shopping_items",[68,1574,502],{"class":82},[68,1576,902],{"class":134},[68,1578,905],{"class":82},[14,1580,1581],{},"Use a list because the order matters and the items may change.",[1522,1583,1585],{"id":1584},"a-screen-size-as-a-tuple","A screen size as a tuple",[58,1587,1589],{"className":60,"code":1588,"language":62,"meta":63,"style":63},"screen_size = (1920, 1080)\nprint(screen_size[0], screen_size[1])\n",[65,1590,1591,1610],{"__ignoreMap":63},[68,1592,1593,1596,1598,1600,1603,1605,1608],{"class":70,"line":71},[68,1594,1595],{"class":74},"screen_size ",[68,1597,79],{"class":78},[68,1599,131],{"class":82},[68,1601,1602],{"class":134},"1920",[68,1604,96],{"class":82},[68,1606,1607],{"class":134}," 1080",[68,1609,366],{"class":82},[68,1611,1612,1614,1616,1619,1621,1623,1626,1629,1631,1633],{"class":70,"line":123},[68,1613,444],{"class":443},[68,1615,447],{"class":82},[68,1617,1618],{"class":450},"screen_size",[68,1620,502],{"class":82},[68,1622,902],{"class":134},[68,1624,1625],{"class":82},"],",[68,1627,1628],{"class":450}," screen_size",[68,1630,502],{"class":82},[68,1632,323],{"class":134},[68,1634,905],{"class":82},[14,1636,1637],{},"Use a tuple because width and height belong together and usually stay fixed.",[1522,1639,1641],{"id":1640},"unique-categories-as-a-set","Unique categories as a set",[58,1643,1645],{"className":60,"code":1644,"language":62,"meta":63,"style":63},"categories = {\"books\", \"games\", \"books\", \"music\"}\nprint(categories)\n",[65,1646,1647,1691],{"__ignoreMap":63},[68,1648,1649,1652,1654,1656,1658,1661,1663,1665,1667,1670,1672,1674,1676,1678,1680,1682,1684,1687,1689],{"class":70,"line":71},[68,1650,1651],{"class":74},"categories ",[68,1653,79],{"class":78},[68,1655,157],{"class":82},[68,1657,87],{"class":86},[68,1659,1660],{"class":90},"books",[68,1662,87],{"class":86},[68,1664,96],{"class":82},[68,1666,99],{"class":86},[68,1668,1669],{"class":90},"games",[68,1671,87],{"class":86},[68,1673,96],{"class":82},[68,1675,99],{"class":86},[68,1677,1660],{"class":90},[68,1679,87],{"class":86},[68,1681,96],{"class":82},[68,1683,99],{"class":86},[68,1685,1686],{"class":90},"music",[68,1688,87],{"class":86},[68,1690,392],{"class":82},[68,1692,1693,1695,1697,1700],{"class":70,"line":123},[68,1694,444],{"class":443},[68,1696,447],{"class":82},[68,1698,1699],{"class":450},"categories",[68,1701,366],{"class":82},[14,1703,1704],{},"Use a set because you only want unique category names.",[1522,1706,1708],{"id":1707},"a-person-record-as-a-dictionary","A person record as a dictionary",[58,1710,1712],{"className":60,"code":1711,"language":62,"meta":63,"style":63},"person = {\n    \"name\": \"Liam\",\n    \"age\": 18,\n    \"city\": \"Boston\"\n}\n\nprint(person[\"city\"])\n",[65,1713,1714,1723,1742,1757,1775,1779,1783],{"__ignoreMap":63},[68,1715,1716,1719,1721],{"class":70,"line":71},[68,1717,1718],{"class":74},"person ",[68,1720,79],{"class":78},[68,1722,1258],{"class":82},[68,1724,1725,1727,1729,1731,1733,1735,1738,1740],{"class":70,"line":123},[68,1726,1263],{"class":86},[68,1728,202],{"class":90},[68,1730,87],{"class":86},[68,1732,207],{"class":82},[68,1734,99],{"class":86},[68,1736,1737],{"class":90},"Liam",[68,1739,87],{"class":86},[68,1741,1278],{"class":82},[68,1743,1744,1746,1748,1750,1752,1755],{"class":70,"line":149},[68,1745,1263],{"class":86},[68,1747,221],{"class":90},[68,1749,87],{"class":86},[68,1751,207],{"class":82},[68,1753,1754],{"class":134}," 18",[68,1756,1278],{"class":82},[68,1758,1759,1761,1764,1766,1768,1770,1773],{"class":70,"line":190},[68,1760,1263],{"class":86},[68,1762,1763],{"class":90},"city",[68,1765,87],{"class":86},[68,1767,207],{"class":82},[68,1769,99],{"class":86},[68,1771,1772],{"class":90},"Boston",[68,1774,747],{"class":86},[68,1776,1777],{"class":70,"line":433},[68,1778,392],{"class":82},[68,1780,1781],{"class":70,"line":440},[68,1782,437],{"emptyLinePlaceholder":436},[68,1784,1785,1787,1789,1792,1794,1796,1798,1800],{"class":70,"line":456},[68,1786,444],{"class":443},[68,1788,447],{"class":82},[68,1790,1791],{"class":450},"person",[68,1793,502],{"class":82},[68,1795,87],{"class":86},[68,1797,1763],{"class":90},[68,1799,87],{"class":86},[68,1801,905],{"class":82},[14,1803,1804],{},"Use a dictionary because each value has a label.",[53,1806,1808],{"id":1807},"common-beginner-mistakes","Common beginner mistakes",[14,1810,1811],{},"Some common causes of confusion are:",[21,1813,1814,1817,1820,1823],{},[24,1815,1816],{},"Choosing a type based on what “looks right” instead of how the data will be used",[24,1818,1819],{},"Using a list for everything because it is the first collection beginners learn",[24,1821,1822],{},"Confusing ordered data with unique data",[24,1824,1825],{},"Not knowing that dictionaries are for named values",[14,1827,1828],{},"Here are some specific mistakes to avoid:",[21,1830,1831,1834,1837,1840],{},[24,1832,1833],{},"Using a set and expecting item order",[24,1835,1836],{},"Using a list when key-value data would be clearer as a dictionary",[24,1838,1839],{},"Trying to change a tuple item",[24,1841,1842],{},"Using a dictionary when only a simple sequence is needed",[14,1844,1845],{},"If you are unsure what kind of object you have while debugging, these checks can help:",[58,1847,1849],{"className":60,"code":1848,"language":62,"meta":63,"style":63},"data = {\"name\": \"Ana\", \"age\": 25}\nvalue = \"name\"\n\nprint(type(data))\nprint(data)\nprint(len(data))\nprint(\"key\" in data)\nprint(value in data)\n",[65,1850,1851,1888,1901,1905,1922,1932,1947,1967],{"__ignoreMap":63},[68,1852,1853,1856,1858,1860,1862,1864,1866,1868,1870,1872,1874,1876,1878,1880,1882,1884,1886],{"class":70,"line":71},[68,1854,1855],{"class":74},"data ",[68,1857,79],{"class":78},[68,1859,157],{"class":82},[68,1861,87],{"class":86},[68,1863,202],{"class":90},[68,1865,87],{"class":86},[68,1867,207],{"class":82},[68,1869,99],{"class":86},[68,1871,212],{"class":90},[68,1873,87],{"class":86},[68,1875,96],{"class":82},[68,1877,99],{"class":86},[68,1879,221],{"class":90},[68,1881,87],{"class":86},[68,1883,207],{"class":82},[68,1885,228],{"class":134},[68,1887,392],{"class":82},[68,1889,1890,1893,1895,1897,1899],{"class":70,"line":123},[68,1891,1892],{"class":74},"value ",[68,1894,79],{"class":78},[68,1896,99],{"class":86},[68,1898,202],{"class":90},[68,1900,747],{"class":86},[68,1902,1903],{"class":70,"line":149},[68,1904,437],{"emptyLinePlaceholder":436},[68,1906,1907,1909,1911,1914,1916,1919],{"class":70,"line":190},[68,1908,444],{"class":443},[68,1910,447],{"class":82},[68,1912,1913],{"class":1090},"type",[68,1915,447],{"class":82},[68,1917,1918],{"class":450},"data",[68,1920,1921],{"class":82},"))\n",[68,1923,1924,1926,1928,1930],{"class":70,"line":433},[68,1925,444],{"class":443},[68,1927,447],{"class":82},[68,1929,1918],{"class":450},[68,1931,366],{"class":82},[68,1933,1934,1936,1938,1941,1943,1945],{"class":70,"line":440},[68,1935,444],{"class":443},[68,1937,447],{"class":82},[68,1939,1940],{"class":443},"len",[68,1942,447],{"class":82},[68,1944,1918],{"class":450},[68,1946,1921],{"class":82},[68,1948,1949,1951,1953,1955,1958,1960,1962,1965],{"class":70,"line":456},[68,1950,444],{"class":443},[68,1952,447],{"class":82},[68,1954,87],{"class":86},[68,1956,1957],{"class":90},"key",[68,1959,87],{"class":86},[68,1961,1129],{"class":1128},[68,1963,1964],{"class":450}," data",[68,1966,366],{"class":82},[68,1968,1969,1971,1973,1975,1978,1980],{"class":70,"line":468},[68,1970,444],{"class":443},[68,1972,447],{"class":82},[68,1974,1892],{"class":450},[68,1976,1977],{"class":1128},"in",[68,1979,1964],{"class":450},[68,1981,366],{"class":82},[14,1983,1984],{},"These are useful for understanding:",[21,1986,1987,1990,1993,1996],{},[24,1988,1989],{},"what the object type is",[24,1991,1992],{},"what values it currently contains",[24,1994,1995],{},"how many items it has",[24,1997,1998],{},"whether a key or value exists",[53,2000,2002],{"id":2001},"how-this-page-differs-from-the-type-specific-pages","How this page differs from the type-specific pages",[14,2004,2005,2006,712],{},"This page helps you ",[27,2007,2008],{},"choose between collection types",[14,2010,2011],{},"The type-specific pages go deeper:",[21,2013,2014,2019,2024,2029],{},[24,2015,2016,2018],{},[637,2017,812],{"href":811}," covers list syntax and common list operations",[24,2020,2021,2023],{},[637,2022,987],{"href":986}," explains tuple syntax and how tuples are used",[24,2025,2026,2028],{},[637,2027,1422],{"href":1421}," covers keys, values, and common dictionary patterns",[24,2030,2031,2033],{},[637,2032,1214],{"href":1213}," explains uniqueness and set behavior",[14,2035,2036],{},"How-to pages solve one task, such as removing duplicates or checking whether a dictionary key exists.",[53,2038,2040],{"id":2039},"faq","FAQ",[1522,2042,2044],{"id":2043},"should-i-use-a-list-or-a-tuple","Should I use a list or a tuple?",[14,2046,2047],{},"Use a list if you will change the items. Use a tuple if the values should stay the same.",[1522,2049,2051],{"id":2050},"when-should-i-use-a-set-instead-of-a-list","When should I use a set instead of a list?",[14,2053,2054],{},"Use a set when you need unique values and do not care about indexing.",[1522,2056,2058],{"id":2057},"why-use-a-dictionary-instead-of-a-list","Why use a dictionary instead of a list?",[14,2060,2061,2062,2064,2065,2067,2068,712],{},"Use a dictionary when each value has a name, like ",[65,2063,202],{},", ",[65,2066,221],{},", or ",[65,2069,1299],{},[1522,2071,2073],{"id":2072},"can-a-tuple-contain-duplicate-values","Can a tuple contain duplicate values?",[14,2075,2076],{},"Yes. Tuples can contain duplicates, just like lists.",[1522,2078,2080],{"id":2079},"can-i-store-different-data-types-in-these-collections","Can I store different data types in these collections?",[14,2082,2083],{},"Yes. Lists, tuples, sets, and dictionaries can all hold different data types.",[53,2085,2087],{"id":2086},"see-also","See also",[21,2089,2090,2094,2098,2102,2106,2111,2116,2121],{},[24,2091,2092],{},[637,2093,812],{"href":811},[24,2095,2096],{},[637,2097,987],{"href":986},[24,2099,2100],{},[637,2101,1422],{"href":1421},[24,2103,2104],{},[637,2105,1214],{"href":1213},[24,2107,2108],{},[637,2109,2110],{"href":991},"Mutability in Python explained",[24,2112,2113],{},[637,2114,2115],{"href":1208},"How to remove duplicates from a list in Python",[24,2117,2118],{},[637,2119,2120],{"href":1426},"How to check if a key exists in a dictionary in Python",[24,2122,2123],{},[637,2124,2125],{"href":639},"Python list append() method",[2127,2128,2129],"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 .sP7_E, html code.shiki .sP7_E{--shiki-light:#39ADB5;--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 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 .srdBf, html code.shiki .srdBf{--shiki-light:#F76D47;--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 .sptTA, html code.shiki .sptTA{--shiki-light:#6182B8;--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 .sZMiF, html code.shiki .sZMiF{--shiki-light:#E2931D;--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 .s39Yj, html code.shiki .s39Yj{--shiki-light:#39ADB5;--shiki-default:#005CC5;--shiki-dark:#79B8FF}",{"title":63,"searchDepth":123,"depth":123,"links":2131},[2132,2133,2134,2135,2136,2137,2138,2139,2140,2146,2147,2148,2155],{"id":55,"depth":123,"text":56},{"id":255,"depth":123,"text":256},{"id":273,"depth":123,"text":274},{"id":617,"depth":123,"text":618},{"id":815,"depth":123,"text":816},{"id":995,"depth":123,"text":996},{"id":1217,"depth":123,"text":1218},{"id":1430,"depth":123,"text":1431},{"id":1516,"depth":123,"text":1517,"children":2141},[2142,2143,2144,2145],{"id":1524,"depth":149,"text":1525},{"id":1584,"depth":149,"text":1585},{"id":1640,"depth":149,"text":1641},{"id":1707,"depth":149,"text":1708},{"id":1807,"depth":123,"text":1808},{"id":2001,"depth":123,"text":2002},{"id":2039,"depth":123,"text":2040,"children":2149},[2150,2151,2152,2153,2154],{"id":2043,"depth":149,"text":2044},{"id":2050,"depth":149,"text":2051},{"id":2057,"depth":149,"text":2058},{"id":2072,"depth":149,"text":2073},{"id":2079,"depth":149,"text":2080},{"id":2086,"depth":123,"text":2087},"Master when to use lists vs tuples vs sets vs dictionaries in our comprehensive Python beginner guide.","md",{},"\u002Flearn\u002Fwhen-to-use-lists-vs-tuples-vs-sets-vs-dictionaries",{"title":5,"description":2156},"learn\u002Fwhen-to-use-lists-vs-tuples-vs-sets-vs-dictionaries","rFeggN7IZJM08BKD31z-QABQPjuFdI00bWFnCV2yUfY",1777585496626]