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