{"id":37622,"date":"2025-04-22T19:30:04","date_gmt":"2025-04-22T16:30:04","guid":{"rendered":"https:\/\/goit.global\/?post_type=articles&#038;p=37622"},"modified":"2026-04-30T14:33:02","modified_gmt":"2026-04-30T11:33:02","slug":"metody-append-i-extend-u-python-iak-dodaty-elementy-do-spysku","status":"publish","type":"articles","link":"https:\/\/goit.global\/ua\/articles\/metody-append-i-extend-u-python-iak-dodaty-elementy-do-spysku\/","title":{"rendered":"\u041c\u0435\u0442\u043e\u0434\u0438 append() \u0456 extend() \u0443 Python: \u044f\u043a \u0434\u043e\u0434\u0430\u0442\u0438 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438 \u0434\u043e \u0441\u043f\u0438\u0441\u043a\u0443"},"content":{"rendered":"<p>&#1056;&#1086;&#1073;&#1086;&#1090;&#1072; &#1079;&#1110; &#1089;&#1087;&#1080;&#1089;&#1082;&#1072;&#1084;&#1080; &#1074; <a href=\"https:\/\/goit.global\/ua\/articles\/shcho-take-python-i-dlia-choho-vin-potriben\/\" target=\"_blank\" rel=\"noopener\">&#1084;&#1086;&#1074;&#1110; &#1087;&#1088;&#1086;&#1075;&#1088;&#1072;&#1084;&#1091;&#1074;&#1072;&#1085;&#1085;&#1103; Python<\/a> &#1108; &#1073;&#1072;&#1079;&#1086;&#1074;&#1086;&#1102; &#1085;&#1072;&#1074;&#1080;&#1095;&#1082;&#1086;&#1102;, &#1073;&#1077;&#1079; &#1103;&#1082;&#1086;&#1075;&#1086; &#1085;&#1077;&#1084;&#1086;&#1078;&#1083;&#1080;&#1074;&#1086; &#1091;&#1103;&#1074;&#1080;&#1090;&#1080; &#1078;&#1086;&#1076;&#1077;&#1085; &#1088;&#1077;&#1072;&#1083;&#1100;&#1085;&#1080;&#1081; &#1087;&#1088;&#1086;&#1108;&#1082;&#1090;. &#1042;&#1110;&#1076; &#1087;&#1088;&#1086;&#1089;&#1090;&#1080;&#1093; &#1079;&#1072;&#1074;&#1076;&#1072;&#1085;&#1100; &#1076;&#1086; &#1089;&#1082;&#1083;&#1072;&#1076;&#1085;&#1080;&#1093; &#1072;&#1083;&#1075;&#1086;&#1088;&#1080;&#1090;&#1084;&#1110;&#1074; &ndash; &#1089;&#1087;&#1080;&#1089;&#1082;&#1080; &#1074; &#1055;&#1072;&#1081;&#1090;&#1086;&#1085;&#1110; &#1089;&#1082;&#1088;&#1110;&#1079;&#1100;! &#1042;&#1086;&#1085;&#1080; &#1091;&#1085;&#1110;&#1074;&#1077;&#1088;&#1089;&#1072;&#1083;&#1100;&#1085;&#1110;, &#1076;&#1080;&#1085;&#1072;&#1084;&#1110;&#1095;&#1085;&#1110; &#1090;&#1072; &#1076;&#1086;&#1079;&#1074;&#1086;&#1083;&#1103;&#1102;&#1090;&#1100; &#1079;&#1088;&#1091;&#1095;&#1085;&#1086; &#1079;&#1073;&#1077;&#1088;&#1110;&#1075;&#1072;&#1090;&#1080; &#1076;&#1072;&#1085;&#1110;. &#1040;&#1083;&#1077; &#1097;&#1086;&#1073; &#1074;&#1080;&#1082;&#1086;&#1088;&#1080;&#1089;&#1090;&#1086;&#1074;&#1091;&#1074;&#1072;&#1090;&#1080; &#1089;&#1087;&#1080;&#1089;&#1082;&#1080; &#1087;&#1086; &#1084;&#1072;&#1082;&#1089;&#1080;&#1084;&#1091;&#1084;&#1091;, &#1087;&#1086;&#1090;&#1088;&#1110;&#1073;&#1085;&#1086; &#1088;&#1086;&#1079;&#1091;&#1084;&#1110;&#1090;&#1080;, &#1103;&#1082; &#1079; &#1085;&#1080;&#1084;&#1080; &#1087;&#1088;&#1072;&#1074;&#1080;&#1083;&#1100;&#1085;&#1086; &#1087;&#1088;&#1072;&#1094;&#1102;&#1074;&#1072;&#1090;&#1080;.<\/p>\n<p>&#1040; &#1103;&#1082;&#1097;&#1086; &#1090;&#1080; &#1074;&#1080;&#1074;&#1095;&#1072;&#1108;&#1096; &#1094;&#1102; &#1084;&#1086;&#1074;&#1091; &#1087;&#1088;&#1086;&#1075;&#1088;&#1072;&#1084;&#1091;&#1074;&#1072;&#1085;&#1085;&#1103; &#1095;&#1080; &#1074;&#1078;&#1077; &#1087;&#1080;&#1096;&#1077;&#1096; &#1082;&#1086;&#1076;, &#1090;&#1086; &#1085;&#1072;&#1087;&#1077;&#1074;&#1085;&#1086; &#1089;&#1090;&#1080;&#1082;&#1072;&#1074;&#1089;&#1103;(-&#1083;&#1072;&#1089;&#1100;) &#1079; &#1085;&#1077;&#1086;&#1073;&#1093;&#1110;&#1076;&#1085;&#1110;&#1089;&#1090;&#1102; &#1076;&#1086;&#1076;&#1072;&#1090;&#1080; &#1077;&#1083;&#1077;&#1084;&#1077;&#1085;&#1090; &#1076;&#1086; &#1089;&#1087;&#1080;&#1089;&#1082;&#1091; Python. &#1044;&#1083;&#1103; &#1094;&#1100;&#1086;&#1075;&#1086; &#1085;&#1072;&#1081;&#1095;&#1072;&#1089;&#1090;&#1110;&#1096;&#1077; &#1074;&#1080;&#1082;&#1086;&#1088;&#1080;&#1089;&#1090;&#1086;&#1074;&#1091;&#1102;&#1090;&#1100; &#1084;&#1077;&#1090;&#1086;&#1076;&#1080; append() &#1090;&#1072; extend(). &#1059; &#1094;&#1100;&#1086;&#1084;&#1091; &#1084;&#1072;&#1090;&#1077;&#1088;&#1110;&#1072;&#1083;&#1110; &#1076;&#1086;&#1082;&#1083;&#1072;&#1076;&#1085;&#1086; &#1088;&#1086;&#1079;&#1073;&#1077;&#1088;&#1077;&#1084;&#1086;&#1089;&#1103; &#1079; &#1090;&#1080;&#1084;, &#1097;&#1086; &#1090;&#1072;&#1082;&#1077; append &#1090;&#1072; extend &#1091; <a href=\"https:\/\/goit.global\/ua\/articles\/khto-takyy-python-rozrobnyk-i-chym-vin-zaymaietsia\/\" target=\"_blank\" rel=\"noopener\">&#1055;&#1072;&#1081;&#1090;&#1086;&#1085;<\/a>, &#1091; &#1095;&#1086;&#1084;&#1091; &#1084;&#1110;&#1078; &#1085;&#1080;&#1084;&#1080; &#1088;&#1110;&#1079;&#1085;&#1080;&#1094;&#1103;, &#1103;&#1082; &#1074;&#1086;&#1085;&#1080; &#1087;&#1088;&#1072;&#1094;&#1102;&#1102;&#1090;&#1100; &#1110; &#1074; &#1103;&#1082;&#1080;&#1093; &#1074;&#1080;&#1087;&#1072;&#1076;&#1082;&#1072;&#1093; &#1111;&#1093; &#1074;&#1072;&#1088;&#1090;&#1086; &#1079;&#1072;&#1089;&#1090;&#1086;&#1089;&#1086;&#1074;&#1091;&#1074;&#1072;&#1090;&#1080;.<\/p>\n<p><a href=\"https:\/\/python-m-lp-ua.goit.global\/?amp%3Butm_medium=articles&#038;amp%3Butm_campaign=37622\"><picture id=\"gb-banner-rxv62sj3d6e\" class=\"gb-banner\" data-gb-banner=\"true\"><source srcset=\"https:\/\/web-dev-goit.s3.eu-north-1.amazonaws.com\/app\/uploads\/2023\/12\/19004756\/1280-Python.jpg\" media=\"(min-width:1280px)\"><\/source><source srcset=\"https:\/\/web-dev-goit.s3.eu-north-1.amazonaws.com\/app\/uploads\/2023\/12\/19004754\/1024-Python.jpg\" media=\"(min-width:1024px)\"><\/source><source srcset=\"https:\/\/web-dev-goit.s3.eu-north-1.amazonaws.com\/app\/uploads\/2023\/12\/19004752\/768-Python.jpg\" media=\"(min-width:768px)\"><\/source><source srcset=\"https:\/\/web-dev-goit.s3.eu-north-1.amazonaws.com\/app\/uploads\/2023\/12\/19004750\/480x159-Python.jpg\" media=\"(min-width:480px)\"><\/source><\/picture><\/a>\n<\/p>\n<h2>&#1065;&#1086; &#1090;&#1072;&#1082;&#1077; &#1089;&#1087;&#1080;&#1089;&#1086;&#1082; &#1091; Python &#1110; &#1085;&#1072;&#1074;&#1110;&#1097;&#1086; &#1074;&#1110;&#1085; &#1087;&#1086;&#1090;&#1088;&#1110;&#1073;&#1077;&#1085;<\/h2>\n<p>\n&#1057;&#1087;&#1080;&#1089;&#1086;&#1082; (<a href=\"https:\/\/goit.global\/ua\/articles\/yak-vyvchyty-anhliysku-samostiyno-i-proyty-spivbesidu-na-robotu\/\" target=\"_blank\" rel=\"noopener\">&#1072;&#1085;&#1075;&#1083;&#1110;&#1081;&#1089;&#1100;&#1082;&#1086;&#1102;<\/a> list) &ndash; &#1094;&#1077; &#1079;&#1084;&#1110;&#1085;&#1102;&#1074;&#1072;&#1085;&#1080;&#1081; &#1091;&#1087;&#1086;&#1088;&#1103;&#1076;&#1082;&#1086;&#1074;&#1072;&#1085;&#1080;&#1081; &#1082;&#1086;&#1085;&#1090;&#1077;&#1081;&#1085;&#1077;&#1088; &#1091; &#1055;&#1072;&#1081;&#1090;&#1086;&#1085;&#1110;, &#1103;&#1082;&#1080;&#1081; &#1084;&#1086;&#1078;&#1077; &#1084;&#1110;&#1089;&#1090;&#1080;&#1090;&#1080; &#1086;&#1073;&rsquo;&#1108;&#1082;&#1090;&#1080; &#1088;&#1110;&#1079;&#1085;&#1080;&#1093; &#1090;&#1080;&#1087;&#1110;&#1074;: &#1095;&#1080;&#1089;&#1083;&#1072;, &#1088;&#1103;&#1076;&#1082;&#1080;, &#1082;&#1086;&#1088;&#1090;&#1077;&#1078;&#1110;, &#1089;&#1083;&#1086;&#1074;&#1085;&#1080;&#1082;&#1080;, &#1110;&#1085;&#1096;&#1110; &#1089;&#1087;&#1080;&#1089;&#1082;&#1080; &#1090;&#1072; &#1085;&#1072;&#1074;&#1110;&#1090;&#1100; &#1092;&#1091;&#1085;&#1082;&#1094;&#1110;&#1111;. &#1047;&#1072;&#1074;&#1076;&#1103;&#1082;&#1080; &#1094;&#1100;&#1086;&#1084;&#1091; &#1089;&#1087;&#1080;&#1089;&#1082;&#1080; &#1096;&#1080;&#1088;&#1086;&#1082;&#1086; &#1079;&#1072;&#1089;&#1090;&#1086;&#1089;&#1086;&#1074;&#1091;&#1102;&#1090;&#1100;&#1089;&#1103; &#1074; &#1072;&#1083;&#1075;&#1086;&#1088;&#1080;&#1090;&#1084;&#1072;&#1093;, &#1088;&#1086;&#1073;&#1086;&#1090;&#1110; &#1079; &#1092;&#1072;&#1081;&#1083;&#1072;&#1084;&#1080; &#1090;&#1072; <a href=\"https:\/\/goit.global\/ua\/articles\/mashynne-navchannia-shcho-tse-take-iak-pratsiuie-i-dlia-choho-vykorystovuietsia\/\" target=\"_blank\" rel=\"noopener\">&#1084;&#1072;&#1096;&#1080;&#1085;&#1085;&#1086;&#1084;&#1091; &#1085;&#1072;&#1074;&#1095;&#1072;&#1085;&#1085;&#1110;<\/a>.<\/p>\n<p>&#1057;&#1090;&#1074;&#1086;&#1088;&#1080;&#1090;&#1080; &#1089;&#1087;&#1080;&#1089;&#1086;&#1082; &#1076;&#1086;&#1089;&#1080;&#1090;&#1100; &#1083;&#1077;&#1075;&#1082;&#1086;, &#1088;&#1086;&#1079;&#1075;&#1083;&#1103;&#1085;&#1077;&#1084;&#1086; &#1082;&#1110;&#1083;&#1100;&#1082;&#1072; &#1087;&#1088;&#1080;&#1082;&#1083;&#1072;&#1076;&#1110;&#1074;:<\/p>\n<p><strong>mixed_list = [1, &#8220;hello&#8221;, [2, 3], (4, 5)];<\/strong><\/p>\n<p><strong>numbers = [1, 2, 3];<\/strong><\/p>\n<p><strong>words = [&#8220;Python&#8221;, &#8220;JavaScript&#8221;];<\/strong><\/p>\n<p><strong>mixed = [1, &#8220;text&#8221;, [2, 3], (4, 5)];<\/strong><\/p>\n<p><strong>cities = [&#8216;Kyiv&#8217;, &#8216;Lviv&#8217;, &#8216;Odesa&#8217;]<\/strong><\/p>\n<p>&#1057;&#1087;&#1080;&#1089;&#1082;&#1080; &#1074; Python &#1087;&#1110;&#1076;&#1090;&#1088;&#1080;&#1084;&#1091;&#1102;&#1090;&#1100; &#1110;&#1085;&#1076;&#1077;&#1082;&#1089;&#1091;&#1074;&#1072;&#1085;&#1085;&#1103;, &#1079;&#1088;&#1110;&#1079;&#1080;, &#1084;&#1077;&#1090;&#1086;&#1076;&#1080; &#1076;&#1083;&#1103; &#1079;&#1084;&#1110;&#1085;&#1080;, &#1076;&#1086;&#1076;&#1072;&#1074;&#1072;&#1085;&#1085;&#1103; &#1090;&#1072; &#1074;&#1080;&#1076;&#1072;&#1083;&#1077;&#1085;&#1085;&#1103; &#1077;&#1083;&#1077;&#1084;&#1077;&#1085;&#1090;&#1110;&#1074;, &#1072; &#1090;&#1072;&#1082;&#1086;&#1078; &#1072;&#1082;&#1090;&#1080;&#1074;&#1085;&#1086; &#1074;&#1080;&#1082;&#1086;&#1088;&#1080;&#1089;&#1090;&#1086;&#1074;&#1091;&#1102;&#1090;&#1100;&#1089;&#1103; &#1074; &#1087;&#1086;&#1074;&#1089;&#1103;&#1082;&#1076;&#1077;&#1085;&#1085;&#1080;&#1093; &#1079;&#1072;&#1076;&#1072;&#1095;&#1072;&#1093;: &#1074;&#1110;&#1076; &#1072;&#1085;&#1072;&#1083;&#1110;&#1079;&#1091; &#1076;&#1072;&#1085;&#1080;&#1093; &#1076;&#1086; &#1074;&#1077;&#1073;&#1088;&#1086;&#1079;&#1088;&#1086;&#1073;&#1082;&#1080;. &#1031;&#1093;&#1085;&#1103; &#1089;&#1090;&#1088;&#1091;&#1082;&#1090;&#1091;&#1088;&#1072; &#1076;&#1072;&#1108; &#1075;&#1085;&#1091;&#1095;&#1082;&#1110;&#1089;&#1090;&#1100; &#1110; &#1079;&#1088;&#1091;&#1095;&#1085;&#1110;&#1089;&#1090;&#1100;. &#1047;&#1110; &#1089;&#1087;&#1080;&#1089;&#1082;&#1072;&#1084;&#1080; &#1083;&#1077;&#1075;&#1082;&#1086; &#1074;&#1080;&#1082;&#1086;&#1085;&#1091;&#1074;&#1072;&#1090;&#1080; &#1089;&#1086;&#1088;&#1090;&#1091;&#1074;&#1072;&#1085;&#1085;&#1103;, &#1092;&#1110;&#1083;&#1100;&#1090;&#1088;&#1072;&#1094;&#1110;&#1102;, &#1110;&#1090;&#1077;&#1088;&#1072;&#1094;&#1110;&#1102;, &#1079;&#1072;&#1084;&#1110;&#1085;&#1091; &#1090;&#1072; &#1110;&#1085;&#1096;&#1110; &#1086;&#1087;&#1077;&#1088;&#1072;&#1094;&#1110;&#1111;.\n<\/p>\n<h2>&#1052;&#1077;&#1090;&#1086;&#1076; append() &#1074; Python &ndash; &#1097;&#1086; &#1094;&#1077; &#1110; &#1103;&#1082; &#1087;&#1088;&#1072;&#1094;&#1102;&#1108;<\/h2>\n<p>\n&#1055;&#1086;&#1095;&#1085;&#1077;&#1084;&#1086; &#1079; &#1084;&#1077;&#1090;&#1086;&#1076;&#1091; append &#1091; &#1055;&#1072;&#1081;&#1090;&#1086;&#1085;. &#1065;&#1086; &#1090;&#1072;&#1082;&#1077; append()? &#1052;&#1077;&#1090;&#1086;&#1076; append() &#1076;&#1086;&#1076;&#1072;&#1108; &#1086;&#1076;&#1080;&#1085; &#1077;&#1083;&#1077;&#1084;&#1077;&#1085;&#1090; &#1091; &#1082;&#1110;&#1085;&#1077;&#1094;&#1100; &#1089;&#1087;&#1080;&#1089;&#1082;&#1091;. &#1062;&#1077; &#1084;&#1086;&#1078;&#1077; &#1073;&#1091;&#1090;&#1080; &#1095;&#1080;&#1089;&#1083;&#1086;, &#1088;&#1103;&#1076;&#1086;&#1082;, &#1082;&#1086;&#1088;&#1090;&#1077;&#1078;, &#1110;&#1085;&#1096;&#1080;&#1081; &#1089;&#1087;&#1080;&#1089;&#1086;&#1082; &#1072;&#1073;&#1086; &#1073;&#1091;&#1076;&#1100;&#8209;&#1103;&#1082;&#1080;&#1081; &#1086;&#1073;&rsquo;&#1108;&#1082;&#1090; <a href=\"https:\/\/goit.global\/ua\/articles\/z-choho-pochaty-vyvchennia-python-10-prostykh-krokiv\/\" target=\"_blank\" rel=\"noopener\">Python<\/a>. &#1042;&#1110;&#1085; &#1085;&#1077; &#1087;&#1086;&#1074;&#1077;&#1088;&#1090;&#1072;&#1108; &#1085;&#1086;&#1074;&#1080;&#1081; &#1089;&#1087;&#1080;&#1089;&#1086;&#1082;, &#1072; &#1079;&#1084;&#1110;&#1085;&#1102;&#1108; &#1085;&#1072;&#1103;&#1074;&#1085;&#1080;&#1081;. &#1062;&#1077; &#1087;&#1088;&#1086;&#1089;&#1090;&#1080;&#1081; &#1089;&#1087;&#1086;&#1089;&#1110;&#1073; &#1076;&#1086;&#1076;&#1072;&#1074;&#1072;&#1085;&#1085;&#1103; &#1077;&#1083;&#1077;&#1084;&#1077;&#1085;&#1090;&#1072; &#1076;&#1086; &#1089;&#1087;&#1080;&#1089;&#1082;&#1091; &#1074; &#1055;&#1072;&#1081;&#1090;&#1086;&#1085;.\n<\/p>\n<h3>&#1057;&#1080;&#1085;&#1090;&#1072;&#1082;&#1089;&#1080;&#1089;<\/h3>\n<p>\nlist.append(item), &#1076;&#1077;:\n<\/p>\n<ul>\n<li aria-level=\"1\">list &ndash; &#1090;&#1074;&#1110;&#1081; &#1074;&#1080;&#1093;&#1110;&#1076;&#1085;&#1080;&#1081; &#1089;&#1087;&#1080;&#1089;&#1086;&#1082;;<\/li>\n<li aria-level=\"1\">item &ndash; &#1086;&#1073;&rsquo;&#1108;&#1082;&#1090;, &#1103;&#1082;&#1080;&#1081; &#1090;&#1080; &#1076;&#1086;&#1076;&#1072;&#1108;&#1096; (&#1095;&#1080;&#1089;&#1083;&#1086;, &#1088;&#1103;&#1076;&#1086;&#1082;, &#1089;&#1087;&#1080;&#1089;&#1086;&#1082;, &#1082;&#1086;&#1088;&#1090;&#1077;&#1078; &#1090;&#1086;&#1097;&#1086;).<\/li>\n<\/ul>\n<h3>&#1055;&#1088;&#1080;&#1082;&#1083;&#1072;&#1076;&#1080;<\/h3>\n<p>\n&#1044;&#1086;&#1076;&#1072;&#1108;&#1084;&#1086; &#1095;&#1080;&#1089;&#1083;&#1086;:<\/p>\n<p><strong>nums = [1, 2]<\/strong><\/p>\n<p><strong>nums.append(3)<\/strong><\/p>\n<p><strong>print(nums)&nbsp; # [1, 2, 3]<\/strong><\/p>\n<p>&#1044;&#1086;&#1076;&#1072;&#1108;&#1084;&#1086; &#1088;&#1103;&#1076;&#1086;&#1082;:<\/p>\n<p><strong>words = [&#8220;hello&#8221;]<\/strong><\/p>\n<p><strong>words.append(&#8220;world&#8221;)<\/strong><\/p>\n<p><strong>print(words)&nbsp; # [&#8216;hello&#8217;, &#8216;world&#8217;]<\/strong><\/p>\n<p>&#1044;&#1086;&#1076;&#1072;&#1108;&#1084;&#1086; &#1089;&#1087;&#1080;&#1089;&#1086;&#1082; &#1103;&#1082; &#1086;&#1076;&#1080;&#1085; &#1077;&#1083;&#1077;&#1084;&#1077;&#1085;&#1090;:<\/p>\n<p><strong>items = [1, 2]<\/strong><\/p>\n<p><strong>items.append([3, 4])<\/strong><\/p>\n<p><strong>print(items)&nbsp; # [1, 2, [3, 4]]<\/strong><\/p>\n<p>&#1071;&#1082; &#1074;&#1080;&#1076;&#1085;&#1086;, append() &#1085;&#1077; &#1088;&#1086;&#1079;&#1075;&#1086;&#1088;&#1090;&#1072;&#1108; &#1074;&#1082;&#1083;&#1072;&#1076;&#1077;&#1085;&#1110; &#1089;&#1090;&#1088;&#1091;&#1082;&#1090;&#1091;&#1088;&#1080;. &#1042;&#1110;&#1085; &#1087;&#1088;&#1086;&#1089;&#1090;&#1086; &#1076;&#1086;&#1076;&#1072;&#1108; &#1086;&#1073;&rsquo;&#1108;&#1082;&#1090; &#1091; &#1082;&#1110;&#1085;&#1077;&#1094;&#1100;.<\/p>\n<p><a href=\"https:\/\/test-lp-ua.goit.global\/?amp%3Butm_medium=articles&#038;amp%3Butm_campaign=37622\"><picture id=\"gb-banner-ozcmovbb7pk\" class=\"gb-banner\" data-gb-banner=\"true\"><source srcset=\"https:\/\/web-dev-goit.s3.eu-north-1.amazonaws.com\/app\/uploads\/2023\/10\/08013207\/1280X424.png\" media=\"(min-width:1280px)\"><\/source><source srcset=\"https:\/\/web-dev-goit.s3.eu-north-1.amazonaws.com\/app\/uploads\/2023\/10\/08013202\/1024X340.png\" media=\"(min-width:1024px)\"><\/source><source srcset=\"https:\/\/web-dev-goit.s3.eu-north-1.amazonaws.com\/app\/uploads\/2023\/10\/08013157\/768X256.png\" media=\"(min-width:768px)\"><\/source><source srcset=\"https:\/\/web-dev-goit.s3.eu-north-1.amazonaws.com\/app\/uploads\/2023\/10\/08013154\/480X160.png\" media=\"(min-width:480px)\"><\/source><\/picture><\/a>\n<\/p>\n<h2>&#1052;&#1077;&#1090;&#1086;&#1076; extend() &#1074; Python &ndash; &#1097;&#1086; &#1088;&#1086;&#1073;&#1080;&#1090;&#1100; &#1110; &#1082;&#1086;&#1083;&#1080; &#1087;&#1086;&#1090;&#1088;&#1110;&#1073;&#1077;&#1085;<\/h2>\n<p>\n&#1058;&#1077;&#1087;&#1077;&#1088; &#1087;&#1088;&#1086; &#1084;&#1077;&#1090;&#1086;&#1076; extend &#1091; <a href=\"https:\/\/goit.global\/ua\/articles\/mova-prohramuvannia-python-dlia-mashynnoho-navchannia-ta-shtuchnoho-intelektu\/\" target=\"_blank\" rel=\"noopener\">&#1055;&#1072;&#1081;&#1090;&#1086;&#1085;<\/a>. &#1065;&#1086; &#1090;&#1072;&#1082;&#1077; extend()? &#1052;&#1077;&#1090;&#1086;&#1076; extend() &#1074;&#1080;&#1082;&#1086;&#1088;&#1080;&#1089;&#1090;&#1086;&#1074;&#1091;&#1108;&#1090;&#1100;&#1089;&#1103; &#1076;&#1083;&#1103; &#1090;&#1086;&#1075;&#1086;, &#1097;&#1086;&#1073; &#1076;&#1086;&#1076;&#1072;&#1090;&#1080; &#1074; &#1089;&#1087;&#1080;&#1089;&#1086;&#1082; &#1086;&#1076;&#1088;&#1072;&#1079;&#1091; &#1082;&#1110;&#1083;&#1100;&#1082;&#1072; &#1077;&#1083;&#1077;&#1084;&#1077;&#1085;&#1090;&#1110;&#1074; &#1079; &#1110;&#1090;&#1077;&#1088;&#1086;&#1074;&#1072;&#1085;&#1086;&#1075;&#1086; &#1086;&#1073;&rsquo;&#1108;&#1082;&#1090;&#1072; &ndash; &#1110;&#1085;&#1096;&#1086;&#1075;&#1086; &#1089;&#1087;&#1080;&#1089;&#1082;&#1091;, &#1088;&#1103;&#1076;&#1082;&#1072;, &#1084;&#1085;&#1086;&#1078;&#1080;&#1085;&#1080;, &#1082;&#1086;&#1088;&#1090;&#1077;&#1078;&#1091; &#1090;&#1086;&#1097;&#1086;. &#1053;&#1072; &#1074;&#1110;&#1076;&#1084;&#1110;&#1085;&#1091; &#1074;&#1110;&#1076; append(), &#1074;&#1110;&#1085; &laquo;&#1088;&#1086;&#1079;&#1087;&#1072;&#1082;&#1086;&#1074;&#1091;&#1108;&raquo; &#1074;&#1084;&#1110;&#1089;&#1090; &#1086;&#1073;&rsquo;&#1108;&#1082;&#1090;&#1072;.\n<\/p>\n<h3>&#1057;&#1080;&#1085;&#1090;&#1072;&#1082;&#1089;&#1080;&#1089;<\/h3>\n<p>\nlist.extend(iterable), &#1076;&#1077;:\n<\/p>\n<ul>\n<li aria-level=\"1\">iterable &ndash; &#1073;&#1091;&#1076;&#1100;&#8209;&#1103;&#1082;&#1080;&#1081; &#1086;&#1073;&rsquo;&#1108;&#1082;&#1090;, &#1087;&#1086; &#1103;&#1082;&#1086;&#1084;&#1091; &#1084;&#1086;&#1078;&#1085;&#1072; &#1087;&#1088;&#1086;&#1081;&#1090;&#1080;&#1089;&#1103; &#1074; &#1094;&#1080;&#1082;&#1083;&#1110;: &#1089;&#1087;&#1080;&#1089;&#1086;&#1082;, &#1088;&#1103;&#1076;&#1086;&#1082;, &#1082;&#1086;&#1088;&#1090;&#1077;&#1078;, &#1084;&#1085;&#1086;&#1078;&#1080;&#1085;&#1072;.<\/li>\n<\/ul>\n<h3>&#1055;&#1088;&#1080;&#1082;&#1083;&#1072;&#1076;&#1080;<\/h3>\n<p>\n&#1044;&#1086;&#1076;&#1072;&#1108;&#1084;&#1086; &#1077;&#1083;&#1077;&#1084;&#1077;&#1085;&#1090;&#1080; &#1089;&#1087;&#1080;&#1089;&#1082;&#1091;:<\/p>\n<p><strong>nums = [1, 2]<\/strong><\/p>\n<p><strong>nums.extend([3, 4])<\/strong><\/p>\n<p><strong>print(nums)&nbsp; # [1, 2, 3, 4]<\/strong><\/p>\n<p>&#1044;&#1086;&#1076;&#1072;&#1108;&#1084;&#1086; &#1089;&#1080;&#1084;&#1074;&#1086;&#1083;&#1080; &#1088;&#1103;&#1076;&#1082;&#1072;:<\/p>\n<p><strong>chars = [&#8216;a&#8217;]<\/strong><\/p>\n<p><strong>chars.extend(&#8220;bc&#8221;)<\/strong><\/p>\n<p><strong>print(chars)&nbsp; # [&#8216;a&#8217;, &#8216;b&#8217;, &#8216;c&#8217;]<\/strong><\/p>\n<p>&#1071;&#1082;&#1097;&#1086; &#1090;&#1080; &#1093;&#1086;&#1095;&#1077;&#1096; &#1086;&#1073;&rsquo;&#1108;&#1076;&#1085;&#1072;&#1090;&#1080; &#1076;&#1074;&#1072; &#1089;&#1087;&#1080;&#1089;&#1082;&#1080;, &#1090;&#1086; extend() &#1073;&#1091;&#1076;&#1077; &#1073;&#1110;&#1083;&#1100;&#1096; &#1087;&#1110;&#1076;&#1093;&#1086;&#1078;&#1080;&#1084; &#1074;&#1072;&#1088;&#1110;&#1072;&#1085;&#1090;&#1086;&#1084;.\n<\/p>\n<h2>&#1050;&#1086;&#1083;&#1080; &#1074;&#1080;&#1082;&#1086;&#1088;&#1080;&#1089;&#1090;&#1086;&#1074;&#1091;&#1074;&#1072;&#1090;&#1080; append()<\/h2>\n<p>\n&#1042;&#1080;&#1082;&#1086;&#1088;&#1080;&#1089;&#1090;&#1086;&#1074;&#1091;&#1081; append(), &#1103;&#1082;&#1097;&#1086; &#1087;&#1086;&#1090;&#1088;&#1110;&#1073;&#1085;&#1086; &#1076;&#1086;&#1076;&#1072;&#1090;&#1080; &#1086;&#1076;&#1080;&#1085; &#1086;&#1073;&#8217;&#1108;&#1082;&#1090; &#1072;&#1073;&#1086; &#1082;&#1086;&#1083;&#1080; &#1090;&#1080; &#1087;&#1088;&#1072;&#1094;&#1102;&#1108;&#1096; &#1079; &#1087;&#1086;&#1090;&#1086;&#1082;&#1072;&#1084;&#1080; &#1076;&#1072;&#1085;&#1080;&#1093; (&#1085;&#1072;&#1087;&#1088;&#1080;&#1082;&#1083;&#1072;&#1076;, &#1087;&#1086;&#1089;&#1090;&#1088;&#1086;&#1082;&#1086;&#1074;&#1077; &#1079;&#1072;&#1074;&#1072;&#1085;&#1090;&#1072;&#1078;&#1077;&#1085;&#1085;&#1103;). &#1071;&#1082;&#1097;&#1086; &#1074;&#1072;&#1078;&#1083;&#1080;&#1074;&#1072; &#1096;&#1074;&#1080;&#1076;&#1082;&#1110;&#1089;&#1090;&#1100; &#1110; &#1084;&#1110;&#1085;&#1110;&#1084;&#1072;&#1083;&#1100;&#1085;&#1072; &#1079;&#1084;&#1110;&#1085;&#1072; &#1089;&#1090;&#1088;&#1091;&#1082;&#1090;&#1091;&#1088;&#1080;, &#1072; &#1090;&#1072;&#1082;&#1086;&#1078; &#1082;&#1086;&#1083;&#1080; &#1093;&#1086;&#1095;&#1077;&#1096; &#1079;&#1073;&#1077;&#1088;&#1077;&#1075;&#1090;&#1080; &#1089;&#1090;&#1088;&#1091;&#1082;&#1090;&#1091;&#1088;&#1091; &#1077;&#1083;&#1077;&#1084;&#1077;&#1085;&#1090;&#1072;, &#1097;&#1086; &#1076;&#1086;&#1076;&#1072;&#1108;&#1090;&#1100;&#1089;&#1103;.\n<\/p>\n<h2>&#1050;&#1086;&#1083;&#1080; &#1074;&#1080;&#1082;&#1086;&#1088;&#1080;&#1089;&#1090;&#1086;&#1074;&#1091;&#1074;&#1072;&#1090;&#1080; extend()<\/h2>\n<p>\n&#1042;&#1080;&#1082;&#1086;&#1088;&#1080;&#1089;&#1090;&#1086;&#1074;&#1091;&#1081; extend(), &#1103;&#1082;&#1097;&#1086; &#1093;&#1086;&#1095;&#1077;&#1096; &#1076;&#1086;&#1076;&#1072;&#1090;&#1080; &#1074;&#1110;&#1076;&#1088;&#1072;&#1079;&#1091; &#1082;&#1110;&#1083;&#1100;&#1082;&#1072; &#1077;&#1083;&#1077;&#1084;&#1077;&#1085;&#1090;&#1110;&#1074; &#1079; &#1110;&#1085;&#1096;&#1086;&#1075;&#1086; &#1076;&#1078;&#1077;&#1088;&#1077;&#1083;&#1072; &#1095;&#1080; &#1082;&#1086;&#1083;&#1080; &#1093;&#1086;&#1095;&#1077;&#1096; &#1086;&#1073;&#8217;&#1108;&#1076;&#1085;&#1072;&#1090;&#1080; &#1089;&#1087;&#1080;&#1089;&#1082;&#1080;. &#1071;&#1082;&#1097;&#1086; &#1095;&#1080;&#1090;&#1072;&#1108;&#1096; &#1079; <a href=\"https:\/\/goit.global\/ua\/articles\/shcho-take-sql-i-de-yoho-vykorystovuiut\/\" target=\"_blank\" rel=\"noopener\">&#1073;&#1072;&#1079;&#1080; &#1076;&#1072;&#1085;&#1080;&#1093;<\/a> &#1110; &#1093;&#1086;&#1095;&#1077;&#1096; &#1076;&#1086;&#1076;&#1072;&#1090;&#1080; &#1074;&#1089;&#1110; &#1079;&#1085;&#1072;&#1095;&#1077;&#1085;&#1085;&#1103;, &#1072; &#1090;&#1072;&#1082;&#1086;&#1078; &#1082;&#1086;&#1083;&#1080; &#1074;&#1080;&#1082;&#1086;&#1088;&#1080;&#1089;&#1090;&#1086;&#1074;&#1091;&#1108;&#1096; &#1089;&#1087;&#1080;&#1089;&#1082;&#1080; &#1103;&#1082; &#1095;&#1077;&#1088;&#1075;&#1080; &#1072;&#1073;&#1086; &#1089;&#1090;&#1077;&#1082;&#1080; &#1074; &#1072;&#1083;&#1075;&#1086;&#1088;&#1080;&#1090;&#1084;&#1072;&#1093;.<\/p>\n<figure id=\"attachment_37605\" aria-describedby=\"caption-attachment-37605\" style=\"width: 756px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-37605\" src=\"https:\/\/web-dev-goit.s3.eu-north-1.amazonaws.com\/app\/uploads\/2025\/04\/22161131\/Metod-extend-v-Python.png\" alt=\"\" width=\"756\" height=\"450\" srcset=\"https:\/\/web-dev-goit.s3.eu-north-1.amazonaws.com\/app\/uploads\/2025\/04\/22161131\/Metod-extend-v-Python.png 1424w, https:\/\/web-dev-goit.s3.eu-north-1.amazonaws.com\/app\/uploads\/2025\/04\/22161131\/Metod-extend-v-Python-300x179.png 300w, https:\/\/web-dev-goit.s3.eu-north-1.amazonaws.com\/app\/uploads\/2025\/04\/22161131\/Metod-extend-v-Python-1024x610.png 1024w, https:\/\/web-dev-goit.s3.eu-north-1.amazonaws.com\/app\/uploads\/2025\/04\/22161131\/Metod-extend-v-Python-768x457.png 768w\" sizes=\"auto, (max-width: 756px) 100vw, 756px\" \/><figcaption id=\"caption-attachment-37605\" class=\"wp-caption-text\"><em>&#1061;&#1086;&#1095;&#1077;&#1096; &#1087;&#1086;&#1073;&#1091;&#1076;&#1091;&#1074;&#1072;&#1090;&#1080; &#1082;&#1072;&#1088;&#8217;&#1108;&#1088;&#1091; &#1074; &#1088;&#1086;&#1079;&#1088;&#1086;&#1073;&#1094;&#1110;? &#1047;&#1072;&#1087;&#1080;&#1096;&#1080;&#1089;&#1100; &#1085;&#1072; <a href=\"https:\/\/goit.global\/ua\/newcomers\/?amp%3Butm_medium=articles&#038;amp%3Butm_campaign=37622\" target=\"_blank\" rel=\"noopener\">&#1073;&#1077;&#1079;&#1087;&#1083;&#1072;&#1090;&#1085;&#1110; &#1084;&#1072;&#1088;&#1072;&#1092;&#1086;&#1085;&#1080;<\/a> &#1090;&#1072; <a href=\"https:\/\/goit.global\/ua\/courses\/?amp%3Butm_medium=articles&#038;amp%3Butm_campaign=37622\" target=\"_blank\" rel=\"noopener\">&#1082;&#1091;&#1088;&#1089;&#1080; GoIT<\/a>!<\/em><\/figcaption><\/figure>\n<h2>&#1055;&#1088;&#1080;&#1082;&#1083;&#1072;&#1076; &#1079;&#1072;&#1076;&#1072;&#1095;<\/h2>\n<p>\n&#1059; &#1090;&#1077;&#1073;&#1077; &#1108; &#1089;&#1087;&#1080;&#1089;&#1086;&#1082; &#1082;&#1086;&#1088;&#1080;&#1089;&#1090;&#1091;&#1074;&#1072;&#1095;&#1110;&#1074;, &#1110; &#1090;&#1080; &#1086;&#1090;&#1088;&#1080;&#1084;&#1091;&#1108;&#1096; &#1085;&#1086;&#1074;&#1086;&#1075;&#1086;:<\/p>\n<p><strong>users = [&laquo;alice&raquo;, &laquo;bob&raquo;]<\/strong><\/p>\n<p><strong>new_user = &laquo;charlie&raquo;<\/strong><\/p>\n<p><strong>users.append(new_user) # [&#8216;alice&#8217;, &#8216;bob&#8217;, &#8216;charlie&#8217;]<\/strong><\/p>\n<p>&#1050;&#1086;&#1083;&#1080; &#1087;&#1088;&#1080;&#1093;&#1086;&#1076;&#1080;&#1090;&#1100; &#1086;&#1076;&#1088;&#1072;&#1079;&#1091; &#1082;&#1110;&#1083;&#1100;&#1082;&#1072; &#1085;&#1086;&#1074;&#1080;&#1093; &#1082;&#1086;&#1088;&#1080;&#1089;&#1090;&#1091;&#1074;&#1072;&#1095;&#1110;&#1074;:<\/p>\n<p><strong>new_users = [&laquo;dave&raquo;, &laquo;eve&raquo;]<\/strong><\/p>\n<p><strong>users.extend(new_users) # [&#8216;alice&#8217;, &#8216;bob&#8217;, &#8216;charlie&#8217;, &#8216;dave&#8217;, &#8216;eve&#8217;]<\/strong>\n<\/p>\n<h2>&#1053;&#1072;&#1081;&#1095;&#1072;&#1089;&#1090;&#1110;&#1096;&#1110; &#1087;&#1086;&#1084;&#1080;&#1083;&#1082;&#1080; &#1087;&#1088;&#1080; &#1074;&#1080;&#1082;&#1086;&#1088;&#1080;&#1089;&#1090;&#1072;&#1085;&#1085;&#1110; append() &#1110; extend()<\/h2>\n<p><strong>&#1053;&#1077;&#1087;&#1088;&#1072;&#1074;&#1080;&#1083;&#1100;&#1085;&#1077; &#1074;&#1080;&#1082;&#1086;&#1088;&#1080;&#1089;&#1090;&#1072;&#1085;&#1085;&#1103; extend() &#1079; &#1088;&#1103;&#1076;&#1082;&#1072;&#1084;&#1080;<\/strong><\/p>\n<p>:<\/p>\n<p><em>names = [&laquo;Anna&raquo;]<\/em><\/p>\n<p><em>names.extend(&laquo;Max&raquo;) # [&#8216;Anna&#8217;, &#8216;M&#8217;, &#8216;a&#8217;, &#8216;x&#8217;] &#10060;<\/em><\/p>\n<p>&#1054;&#1095;&#1110;&#1082;&#1091;&#1108;&#1096;, &#1097;&#1086; &#1088;&#1103;&#1076;&#1086;&#1082; &laquo;Max&raquo; &#1073;&#1091;&#1076;&#1077; &#1076;&#1086;&#1076;&#1072;&#1085;&#1086; &#1103;&#1082; &#1086;&#1076;&#1080;&#1085; &#1077;&#1083;&#1077;&#1084;&#1077;&#1085;&#1090;? &#1042;&#1080;&#1082;&#1086;&#1088;&#1080;&#1089;&#1090;&#1086;&#1074;&#1091;&#1081; append():<\/p>\n<p><em>names.append(&laquo;Max&raquo;) # [&#8216;Anna&#8217;, &#8216;Max&#8217;] &#9989;<\/em><\/p>\n<p>&#1042;&#1080;&#1082;&#1086;&#1088;&#1080;&#1089;&#1090;&#1086;&#1074;&#1091;&#1108;&#1096; extend() &#1079; &#1088;&#1103;&#1076;&#1082;&#1086;&#1084; &ndash; &#1086;&#1090;&#1088;&#1080;&#1084;&#1091;&#1108;&#1096; &#1089;&#1087;&#1080;&#1089;&#1086;&#1082; &#1110;&#1079; &#1089;&#1080;&#1084;&#1074;&#1086;&#1083;&#1110;&#1074;. &#1062;&#1077; &#1085;&#1077; &#1092;&#1072;&#1090;&#1072;&#1083;&#1100;&#1085;&#1072; &#1087;&#1086;&#1084;&#1080;&#1083;&#1082;&#1072;, &#1072;&#1083;&#1077; &#1088;&#1077;&#1079;&#1091;&#1083;&#1100;&#1090;&#1072;&#1090; &#1084;&#1086;&#1078;&#1077; &#1089;&#1090;&#1072;&#1090;&#1080; &#1076;&#1083;&#1103; &#1090;&#1077;&#1073;&#1077; &#1085;&#1077;&#1089;&#1087;&#1086;&#1076;&#1110;&#1074;&#1072;&#1085;&#1080;&#1084;!<\/p>\n<p><strong>&#1044;&#1086;&#1076;&#1072;&#1074;&#1072;&#1085;&#1085;&#1103; &#1089;&#1087;&#1080;&#1089;&#1082;&#1091; &#1095;&#1077;&#1088;&#1077;&#1079; append(), &#1082;&#1086;&#1083;&#1080; &#1087;&#1086;&#1090;&#1088;&#1110;&#1073;&#1077;&#1085; extend()<\/strong>:<\/p>\n<p><em>nums = [1, 2]<\/em><\/p>\n<p><em>nums.append([3, 4])<\/em><\/p>\n<p><em># [1, 2, [3, 4]] &#10060;<\/em><\/p>\n<p><strong>&#1055;&#1088;&#1072;&#1074;&#1080;&#1083;&#1100;&#1085;&#1086;<\/strong>:<\/p>\n<p><em>nums.extend([3, 4])<\/em><\/p>\n<p><em># [1, 2, 3, 4] &#9989;<\/em><\/p>\n<p>&#1044;&#1086;&#1076;&#1072;&#1108;&#1096; &#1089;&#1087;&#1080;&#1089;&#1086;&#1082; &#1095;&#1077;&#1088;&#1077;&#1079; append() &#1110; &#1076;&#1080;&#1074;&#1091;&#1108;&#1096;&#1089;&#1103;, &#1095;&#1086;&#1084;&#1091; &#1079;&#8217;&#1103;&#1074;&#1083;&#1103;&#1102;&#1090;&#1100;&#1089;&#1103; &#1074;&#1082;&#1083;&#1072;&#1076;&#1077;&#1085;&#1110; &#1089;&#1087;&#1080;&#1089;&#1082;&#1080;? &#1058;&#1077;&#1087;&#1077;&#1088; &#1090;&#1080; &#1079;&#1085;&#1072;&#1108;&#1096;, &#1097;&#1086; &#1094;&#1077; &#1094;&#1110;&#1083;&#1082;&#1086;&#1084; &#1086;&#1095;&#1110;&#1082;&#1091;&#1074;&#1072;&#1085;&#1072; &#1087;&#1086;&#1074;&#1077;&#1076;&#1110;&#1085;&#1082;&#1072;!<\/p>\n<p><a href=\"https:\/\/python-m-lp-ua.goit.global\/?amp%3Butm_medium=articles&#038;amp%3Butm_campaign=37622\"><picture id=\"gb-banner-ihtil6ue5u\" class=\"gb-banner\" data-gb-banner=\"true\"><source srcset=\"https:\/\/web-dev-goit.s3.eu-north-1.amazonaws.com\/app\/uploads\/2023\/12\/19004756\/1280-Python.jpg\" media=\"(min-width:1280px)\"><\/source><source srcset=\"https:\/\/web-dev-goit.s3.eu-north-1.amazonaws.com\/app\/uploads\/2023\/12\/19004754\/1024-Python.jpg\" media=\"(min-width:1024px)\"><\/source><source srcset=\"https:\/\/web-dev-goit.s3.eu-north-1.amazonaws.com\/app\/uploads\/2023\/12\/19004752\/768-Python.jpg\" media=\"(min-width:768px)\"><\/source><source srcset=\"https:\/\/web-dev-goit.s3.eu-north-1.amazonaws.com\/app\/uploads\/2023\/12\/19004750\/480x159-Python.jpg\" media=\"(min-width:480px)\"><\/source><\/picture><\/a>\n<\/p>\n<h2>&#1030;&#1085;&#1096;&#1110; &#1089;&#1087;&#1086;&#1089;&#1086;&#1073;&#1080; &#1076;&#1086;&#1076;&#1072;&#1090;&#1080; &#1077;&#1083;&#1077;&#1084;&#1077;&#1085;&#1090; &#1076;&#1086; &#1089;&#1087;&#1080;&#1089;&#1082;&#1091;<\/h2>\n<p>\n&#1059; <a href=\"https:\/\/goit.global\/ua\/articles\/php-abo-python-shcho-vybraty-i-v-chomu-mizh-nymy-riznytsia\/\" target=\"_blank\" rel=\"noopener\">Python<\/a> &#1110;&#1089;&#1085;&#1091;&#1102;&#1090;&#1100; &#1081; &#1110;&#1085;&#1096;&#1110; &#1084;&#1077;&#1090;&#1086;&#1076;&#1080; &#1076;&#1086;&#1076;&#1072;&#1074;&#1072;&#1085;&#1085;&#1103; &#1077;&#1083;&#1077;&#1084;&#1077;&#1085;&#1090;&#1110;&#1074; &#1076;&#1086; &#1089;&#1087;&#1080;&#1089;&#1082;&#1091;.\n<\/p>\n<h3>&#1052;&#1077;&#1090;&#1086;&#1076; insert()<\/h3>\n<p>\n&#1058;&#1072;&#1082;&#1080;&#1081; &#1089;&#1087;&#1086;&#1089;&#1110;&#1073; &#1087;&#1110;&#1076;&#1093;&#1086;&#1076;&#1080;&#1090;&#1100;, &#1103;&#1082;&#1097;&#1086; &#1087;&#1086;&#1090;&#1088;&#1110;&#1073;&#1085;&#1086; &#1074;&#1089;&#1090;&#1072;&#1074;&#1080;&#1090;&#1080; &#1077;&#1083;&#1077;&#1084;&#1077;&#1085;&#1090; &#1091; &#1089;&#1087;&#1080;&#1089;&#1086;&#1082; &#1085;&#1077; &#1074; &#1082;&#1110;&#1085;&#1077;&#1094;&#1100;, &#1072; &#1074; &#1082;&#1086;&#1085;&#1082;&#1088;&#1077;&#1090;&#1085;&#1091; &#1087;&#1086;&#1079;&#1080;&#1094;&#1110;&#1102;:<\/p>\n<p><strong>numbers = [1, 2, 4]<\/strong><\/p>\n<p><strong>numbers.insert(2, 3)<\/strong><\/p>\n<p><strong>print(numbers) # [1, 2, 3, 4]<\/strong>\n<\/p>\n<h3>&#1054;&#1087;&#1077;&#1088;&#1072;&#1090;&#1086;&#1088; +<\/h3>\n<p>\n&#1047; &#1094;&#1080;&#1084; &#1084;&#1077;&#1090;&#1086;&#1076;&#1086;&#1084; &#1090;&#1080; &#1084;&#1086;&#1078;&#1077;&#1096; &#1074;&#1080;&#1082;&#1086;&#1088;&#1080;&#1089;&#1090;&#1086;&#1074;&#1091;&#1074;&#1072;&#1090;&#1080; &#1076;&#1086;&#1076;&#1072;&#1074;&#1072;&#1085;&#1085;&#1103; &#1089;&#1087;&#1080;&#1089;&#1082;&#1110;&#1074;:<\/p>\n<p><strong>list1 = [1, 2]<\/strong><\/p>\n<p><strong>list2 = [3, 4]<\/strong><\/p>\n<p><strong>result = list1 + list2<\/strong><\/p>\n<p><strong>print(result) # [1, 2, 3, 4]<\/strong><\/p>\n<p>&#1040;&#1083;&#1077; &#1094;&#1077; &#1089;&#1090;&#1074;&#1086;&#1088;&#1102;&#1108; &#1085;&#1086;&#1074;&#1080;&#1081; &#1089;&#1087;&#1080;&#1089;&#1086;&#1082;, &#1072; &#1085;&#1077; &#1079;&#1084;&#1110;&#1085;&#1102;&#1108; &#1085;&#1072;&#1103;&#1074;&#1085;&#1080;&#1081;.\n<\/p>\n<h3>&#1056;&#1086;&#1079;&#1096;&#1080;&#1088;&#1077;&#1085;&#1080;&#1081; &#1089;&#1080;&#1085;&#1090;&#1072;&#1082;&#1089;&#1080;&#1089;<\/h3>\n<p>\n&#1058;&#1072;&#1082;&#1080;&#1081; &#1089;&#1087;&#1086;&#1089;&#1110;&#1073; &#1077;&#1082;&#1074;&#1110;&#1074;&#1072;&#1083;&#1077;&#1085;&#1090;&#1085;&#1080;&#1081; extend().<\/p>\n<p><strong>list1 = [1, 2]<\/strong><\/p>\n<p><strong>list2 = [3, 4]<\/strong><\/p>\n<p><strong>list1 += list2<\/strong><\/p>\n<p><strong>print(list1) # [1, 2, 3, 4]<\/strong>\n<\/p>\n<h2>&#1047;&#1072;&#1084;&#1110;&#1089;&#1090;&#1100; &#1087;&#1110;&#1076;&#1089;&#1091;&#1084;&#1082;&#1091;<\/h2>\n<p>\n&#1052;&#1077;&#1090;&#1086;&#1076;&#1080; append() &#1110; extend() &ndash; &#1094;&#1077; &#1086;&#1089;&#1085;&#1086;&#1074;&#1072; &#1076;&#1086;&#1076;&#1072;&#1074;&#1072;&#1085;&#1085;&#1103; &#1077;&#1083;&#1077;&#1084;&#1077;&#1085;&#1090;&#1110;&#1074; &#1076;&#1086; &#1089;&#1087;&#1080;&#1089;&#1082;&#1091; &#1074; &#1055;&#1072;&#1081;&#1090;&#1086;&#1085;. &#1042;&#1086;&#1085;&#1080; &#1076;&#1086;&#1079;&#1074;&#1086;&#1083;&#1103;&#1102;&#1090;&#1100; &#1075;&#1085;&#1091;&#1095;&#1082;&#1086; &#1082;&#1077;&#1088;&#1091;&#1074;&#1072;&#1090;&#1080; &#1074;&#1084;&#1110;&#1089;&#1090;&#1086;&#1084; &#1089;&#1087;&#1080;&#1089;&#1082;&#1091; &#1090;&#1072; &#1087;&#1080;&#1089;&#1072;&#1090;&#1080; &#1083;&#1072;&#1082;&#1086;&#1085;&#1110;&#1095;&#1085;&#1080;&#1081;, &#1079;&#1088;&#1086;&#1079;&#1091;&#1084;&#1110;&#1083;&#1080;&#1081; &#1082;&#1086;&#1076;. &#1071;&#1082;&#1097;&#1086; &#1090;&#1080; &#1087;&#1088;&#1072;&#1094;&#1102;&#1108;&#1096; &#1110;&#1079; &#1084;&#1072;&#1089;&#1080;&#1074;&#1072;&#1084;&#1080; &#1076;&#1072;&#1085;&#1080;&#1093;, &#1110;&#1084;&#1087;&#1086;&#1088;&#1090;&#1091;&#1108;&#1096; &#1088;&#1103;&#1076;&#1082;&#1080; &#1079; &#1092;&#1072;&#1081;&#1083;&#1110;&#1074; &#1072;&#1073;&#1086; &#1073;&#1091;&#1076;&#1091;&#1108;&#1096; &#1074;&#1083;&#1072;&#1089;&#1085;&#1110; &#1089;&#1090;&#1088;&#1091;&#1082;&#1090;&#1091;&#1088;&#1080; &#1076;&#1072;&#1085;&#1080;&#1093; &ndash; &#1074;&#1084;&#1110;&#1085;&#1085;&#1103; &#1087;&#1088;&#1072;&#1074;&#1080;&#1083;&#1100;&#1085;&#1086; &#1076;&#1086;&#1076;&#1072;&#1074;&#1072;&#1090;&#1080; &#1077;&#1083;&#1077;&#1084;&#1077;&#1085;&#1090;&#1080; &#1076;&#1086; &#1089;&#1087;&#1080;&#1089;&#1082;&#1091; &#1088;&#1086;&#1073;&#1080;&#1090;&#1100; &#1090;&#1074;&#1110;&#1081; &#1082;&#1086;&#1076; &#1095;&#1080;&#1089;&#1090;&#1110;&#1096;&#1080;&#1084; &#1110; &#1085;&#1072;&#1076;&#1110;&#1081;&#1085;&#1110;&#1096;&#1080;&#1084;.<\/p>\n<p>&#1058;&#1077;&#1087;&#1077;&#1088;, &#1082;&#1086;&#1083;&#1080; &#1090;&#1080; &#1079;&#1085;&#1072;&#1108;&#1096;, &#1103;&#1082; &#1076;&#1086;&#1076;&#1072;&#1090;&#1080; &#1077;&#1083;&#1077;&#1084;&#1077;&#1085;&#1090; &#1076;&#1086; &#1089;&#1087;&#1080;&#1089;&#1082;&#1091; Python, &#1084;&#1086;&#1078;&#1077;&#1096; &#1074;&#1080;&#1082;&#1086;&#1088;&#1080;&#1089;&#1090;&#1086;&#1074;&#1091;&#1074;&#1072;&#1090;&#1080; &#1094;&#1110; &#1084;&#1077;&#1090;&#1086;&#1076;&#1080; &#1089;&#1074;&#1110;&#1076;&#1086;&#1084;&#1086;, &#1085;&#1077; &#1087;&#1088;&#1080;&#1087;&#1091;&#1089;&#1082;&#1072;&#1102;&#1095;&#1080;&#1089;&#1100; &#1087;&#1086;&#1084;&#1080;&#1083;&#1086;&#1082;. &#1061;&#1086;&#1095;&#1077;&#1096; &#1076;&#1086;&#1076;&#1072;&#1090;&#1080; &#1095;&#1080;&#1089;&#1083;&#1086;, &#1088;&#1103;&#1076;&#1086;&#1082; &#1072;&#1073;&#1086; &#1082;&#1086;&#1088;&#1090;&#1077;&#1078;? &#1058;&#1077;&#1087;&#1077;&#1088; &#1090;&#1080; &#1079;&#1085;&#1072;&#1108;&#1096;, &#1097;&#1086; &#1110; &#1103;&#1082; &#1079;&#1072;&#1089;&#1090;&#1086;&#1089;&#1086;&#1074;&#1091;&#1074;&#1072;&#1090;&#1080;!<\/p>\n<p>&#1040; &#1103;&#1082;&#1097;&#1086; &#1073;&#1072;&#1078;&#1072;&#1108;&#1096; &#1087;&#1086;&#1074;&#1085;&#1110;&#1089;&#1090;&#1102; &#1079;&#1072;&#1085;&#1091;&#1088;&#1080;&#1090;&#1080;&#1089;&#1103; &#1091; &#1074;&#1080;&#1074;&#1095;&#1077;&#1085;&#1085;&#1103; &#1055;&#1072;&#1081;&#1090;&#1086;&#1085;&#1072;, &#1089;&#1087;&#1088;&#1086;&#1073;&#1091;&#1081; &#1089;&#1074;&#1086;&#1111; &#1089;&#1080;&#1083;&#1080; &#1085;&#1072; <a href=\"https:\/\/python-m-lp-ua.goit.global\/?amp%3Butm_medium=articles&#038;amp%3Butm_campaign=37622\" target=\"_blank\" rel=\"noopener\">&#1073;&#1077;&#1079;&#1087;&#1083;&#1072;&#1090;&#1085;&#1086;&#1084;&#1091; &#1084;&#1072;&#1088;&#1072;&#1092;&#1086;&#1085;&#1110; GoIT<\/a>, &#1072; &#1079;&#1075;&#1086;&#1076;&#1086;&#1084; &#1087;&#1088;&#1080;&#1093;&#1086;&#1076;&#1100; &#1085;&#1072; <a href=\"https:\/\/goit.global\/ua\/courses\/python-ds\/?amp%3Butm_medium=articles&#038;amp%3Butm_campaign=37622\" target=\"_blank\" rel=\"noopener\">&#1082;&#1091;&#1088;&#1089;&#1080; Python Data Science<\/a> &#1095;&#1080; <a href=\"https:\/\/goit.global\/ua\/courses\/python\/?amp%3Butm_medium=articles&#038;amp%3Butm_campaign=37622\" target=\"_blank\" rel=\"noopener\">Python Software Engineering<\/a>, &#1097;&#1086;&#1073; &#1089;&#1090;&#1072;&#1090;&#1080; &#1087;&#1088;&#1086;&#1075;&#1088;&#1072;&#1084;&#1110;&#1089;&#1090;&#1086;&#1084; &#1110; &#1086;&#1090;&#1088;&#1080;&#1084;&#1072;&#1090;&#1080; &#1087;&#1077;&#1088;&#1089;&#1087;&#1077;&#1082;&#1090;&#1080;&#1074;&#1085;&#1091; &#1090;&#1072; &#1074;&#1080;&#1089;&#1086;&#1082;&#1086;&#1086;&#1087;&#1083;&#1072;&#1095;&#1091;&#1074;&#1072;&#1085;&#1091; &#1087;&#1088;&#1086;&#1092;&#1077;&#1089;&#1110;&#1102;.<\/p>\n<p><a href=\"https:\/\/test-lp-ua.goit.global\/?amp%3Butm_medium=articles&#038;amp%3Butm_campaign=37622\"><picture id=\"gb-banner-nw77tfa710p\" class=\"gb-banner\" data-gb-banner=\"true\"><source srcset=\"https:\/\/web-dev-goit.s3.eu-north-1.amazonaws.com\/app\/uploads\/2024\/06\/08031551\/1280X424.png\" media=\"(min-width:1280px)\"><\/source><source srcset=\"https:\/\/web-dev-goit.s3.eu-north-1.amazonaws.com\/app\/uploads\/2024\/06\/08031547\/1024X340.png\" media=\"(min-width:1024px)\"><\/source><source srcset=\"https:\/\/web-dev-goit.s3.eu-north-1.amazonaws.com\/app\/uploads\/2024\/06\/08031542\/768X256.png\" media=\"(min-width:768px)\"><\/source><source srcset=\"https:\/\/web-dev-goit.s3.eu-north-1.amazonaws.com\/app\/uploads\/2024\/06\/08031539\/480X160.png\" media=\"(min-width:480px)\"><\/source><\/picture><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u042f\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438 append \u0442\u0430 extend, \u0449\u043e\u0431 \u0434\u043e\u0434\u0430\u0432\u0430\u0442\u0438 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438 \u0434\u043e \u0441\u043f\u0438\u0441\u043a\u0443 \u041f\u0430\u0439\u0442\u043e\u043d\u0430. \u0417\u0430\u043f\u0438\u0448\u0438\u0441\u044c \u043d\u0430 \u0431\u0435\u0437\u043f\u043b\u0430\u0442\u043d\u0456 \u043c\u0430\u0440\u0430\u0444\u043e\u043d\u0438 \u0442\u0430 \u043a\u0443\u0440\u0441\u0438 GoIT!<\/p>\n","protected":false},"featured_media":37613,"menu_order":0,"template":"","meta":{"_acf_changed":false,"inline_featured_image":false},"categories":[12038],"tags":[],"class_list":["post-37622","articles","type-articles","status-publish","has-post-thumbnail","hentry","category-python-data-science"],"acf":[],"_links":{"self":[{"href":"https:\/\/goit.global\/ua\/wp-json\/wp\/v2\/articles\/37622","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/goit.global\/ua\/wp-json\/wp\/v2\/articles"}],"about":[{"href":"https:\/\/goit.global\/ua\/wp-json\/wp\/v2\/types\/articles"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/goit.global\/ua\/wp-json\/wp\/v2\/media\/37613"}],"wp:attachment":[{"href":"https:\/\/goit.global\/ua\/wp-json\/wp\/v2\/media?parent=37622"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/goit.global\/ua\/wp-json\/wp\/v2\/categories?post=37622"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/goit.global\/ua\/wp-json\/wp\/v2\/tags?post=37622"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}