{"id":409,"date":"2015-04-22T23:50:13","date_gmt":"2015-04-22T19:50:13","guid":{"rendered":"http:\/\/pogar-video.ru\/?p=409"},"modified":"2015-09-27T15:03:33","modified_gmt":"2015-09-27T11:03:33","slug":"%d1%81%d1%82%d0%b0%d1%82%d1%8c%d1%8f-%d0%be-%d0%bf%d1%80%d0%be%d0%b3%d1%80%d0%b0%d0%bc%d0%bc%d0%b8%d1%80%d0%be%d0%b2%d0%b0%d0%bd%d0%b8%d0%b8-%d0%bd%d0%b0-%d0%bf%d0%b8%d1%82%d0%be%d0%bd%d0%b5-3","status":"publish","type":"post","link":"https:\/\/pogar-video.ru\/?p=409","title":{"rendered":"\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 Python 3- \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438"},"content":{"rendered":"<p style=\"text-align: center;\">\n\t&sect; 1 &ndash; \u041f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0438 \u0442\u043e\u043c\u0443 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435.\n<\/p>\n<p style=\"text-align: left;\">\n\t\u0412\u043e\u0442 \u043a\u0430\u043a \u0441\u0435\u0439\u0447\u0430\u0441 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u043e\u0434 \u0434\u043b\u044f \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u043a \u0441\u0442\u0440\u043e\u043a\u0438 &ldquo;a&rdquo; \u0434\u043b\u0438\u043d\u043e\u0439 &ldquo;n&rdquo; (n \u043c\u0435\u043d\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u043e \u0434\u043b\u0438\u043d\u0435 a) \u0431\u0435\u0437 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0439.\n<\/p>\n<p style=\"text-align: left;\">\n\t<span style=\"font-size:18px;\"><strong><span style=\"font-family: courier new,courier,monospace;\"><span style=\"color: rgb(165, 42, 42);\">import<\/span> itertools<br \/>\n\t<span style=\"color: rgb(165, 42, 42);\">for<\/span> i <span style=\"color: rgb(165, 42, 42);\">in<\/span> itertools.permutations(a,n):<br \/>\n\t&nbsp;&nbsp;&nbsp; <span style=\"color: rgb(165, 42, 42);\">print<\/span> (<span style=\"color: rgb(0, 100, 0);\">&#39;&#39;<\/span>.join(i))<\/span><\/strong><\/span>\n<\/p>\n<p>\n\t\u0420\u0430\u0431\u043e\u0447\u0438\u0439 \u043a\u043e\u0434 (\u0441 \u0432\u0432\u043e\u0434\u043e\u043c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:\n<\/p>\n<p>\n\t<span style=\"font-size:18px;\"><strong><span style=\"font-family: courier new,courier,monospace;\"><span style=\"color: rgb(165, 42, 42);\">import<\/span> itertools <span style=\"color: rgb(255, 0, 0);\"># \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f<\/span><br \/>\n\ta=<span style=\"color: rgb(165, 42, 42);\">input<\/span>() &nbsp; &nbsp; &nbsp;&nbsp; <span style=\"color: rgb(255, 0, 0);\"># \u0437\u0430\u043f\u0440\u043e\u0441 \u0441\u0442\u0440\u043e\u043a\u0438<\/span><br \/>\n\t<span style=\"color: rgb(165, 42, 42);\">for<\/span> i <span style=\"color: rgb(165, 42, 42);\">in<\/span> itertools.permutations(a,len(a)): &nbsp; &nbsp; <span style=\"color: rgb(255, 0, 0);\"># \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u043a<\/span><br \/>\n\t&nbsp;&nbsp;&nbsp; <span style=\"color: rgb(178, 34, 34);\">print<\/span> (<span style=\"color: rgb(0, 100, 0);\">&#39;&#39;<\/span>.join(i)) &nbsp;&nbsp; <span style=\"color: rgb(255, 0, 0);\"># \u0432\u044b\u0432\u043e\u0434 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430<\/span><\/span><\/strong><\/span>\n<\/p>\n<p>\n\t\u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 &ndash; \u043d\u043e \u0441 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u044f\u043c\u0438:\n<\/p>\n<p>\n\t<span style=\"font-size:16px;\"><strong><span style=\"font-family: courier new,courier,monospace;\"><span style=\"color: rgb(178, 34, 34);\">import<\/span> itertools<br \/>\n\t<span style=\"color: rgb(178, 34, 34);\">for<\/span> i <span style=\"color: rgb(178, 34, 34);\">in<\/span> itertools.product(a,repeat=n):<br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style=\"color: rgb(178, 34, 34);\">print<\/span> (<span style=\"color: rgb(0, 100, 0);\">&#39;&#39;<\/span>.join(i))<\/span><\/strong><\/span>\n<\/p>\n<p>\n\t&nbsp;\n<\/p>\n<p>\n\t<strong><span style=\"font-family:courier new,courier,monospace;\"><span style=\"font-size: 16px;\"><span style=\"color:#B22222;\">import<\/span> itertools<br \/>\n\ta=<span style=\"color:#B22222;\">input<\/span>()<br \/>\n\t<span style=\"color:#B22222;\">for<\/span> i <span style=\"color:#B22222;\">in<\/span> itertools.product(a,repeat=len(a)):<br \/>\n\t&nbsp;&nbsp; <span style=\"color:#B22222;\">print<\/span> (<span style=\"color:#006400;\">&#39;&#39;<\/span>.join(i))<\/span><\/span><\/strong>\n<\/p>\n<p>\n\t\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 &#39;&#39;.join(i). \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0430 \u043a\u043e\u0434\u0430 for i in itertools.permutations(a,n): \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0432\u0438\u0434\u0435 \u0441\u043f\u0438\u0441\u043a\u0430. \u0414\u043b\u044f \u0441\u043b\u0438\u044f\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u043f\u0438\u0441\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 join() \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:\n<\/p>\n<p>\n\t&lt;\u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u043c\u0435\u0441\u0442\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f&gt;.join(&lt;\u0441\u043f\u0438\u0441\u043e\u043a&gt;)\n<\/p>\n<p>\n\t\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<br \/>\n\t<strong><span style=\"font-size:16px;\"><span style=\"font-family: courier new,courier,monospace;\"><span style=\"color:#B22222;\">for<\/span> i <span style=\"color:#B22222;\">in<\/span> itertools.permutations(&ldquo;abc&rdquo;,3):<br \/>\n\t&nbsp;&nbsp; <span style=\"color:#B22222;\">print<\/span> (i)<\/span><\/span><\/strong>\n<\/p>\n<p>\n\t\u0432\u044b\u0432\u0435\u0434\u0435\u0442\n<\/p>\n<p>\n\t(&#39;a&#39;, &#39;b&#39;, &#39;c&#39;)<br \/>\n\t(&#39;a&#39;, &#39;c&#39;, &#39;b&#39;)<br \/>\n\t(&#39;b&#39;, &#39;a&#39;, &#39;c&#39;)<br \/>\n\t(&#39;b&#39;, &#39;c&#39;, &#39;a&#39;)<br \/>\n\t(&#39;c&#39;, &#39;a&#39;, &#39;b&#39;)<br \/>\n\t(&#39;c&#39;, &#39;b&#39;, &#39;a&#39;)\n<\/p>\n<p>\n\t\u0430<br \/>\n\tfor i in itertools.permutations(a,n):<br \/>\n\tprint (&#39;&#39;.join(i))\n<\/p>\n<p>\n\t\u0432\u044b\u0432\u0435\u0434\u0435\u0442<br \/>\n\tabc<br \/>\n\tacb<br \/>\n\tbac<br \/>\n\tbca<br \/>\n\tcab<br \/>\n\tcba\n<\/p>\n<p>\n\t<a href=\"http:\/\/pogar-video.ru\/wp-content\/uploads\/2015\/04\/Python34.zip\" target=\"_blank\"><strong>\u0424\u0430\u0439\u043b\u044b&nbsp; py \u0441 \u043a\u043e\u0434\u043e\u043c<\/strong><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&sect; 1 &ndash; \u041f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0438 \u0442\u043e\u043c\u0443 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435. \u0412\u043e\u0442 \u043a\u0430\u043a \u0441\u0435\u0439\u0447\u0430\u0441 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u043e\u0434 \u0434\u043b\u044f \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u043a \u0441\u0442\u0440\u043e\u043a\u0438 &ldquo;a&rdquo; \u0434\u043b\u0438\u043d\u043e\u0439 &ldquo;n&rdquo; (n \u043c\u0435\u043d\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u043e \u0434\u043b\u0438\u043d\u0435 a) \u0431\u0435\u0437 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0439. import itertools for i in itertools.permutations(a,n): &nbsp;&nbsp;&nbsp; print (&#39;&#39;.join(i)) \u0420\u0430\u0431\u043e\u0447\u0438\u0439 \u043a\u043e\u0434 (\u0441 &hellip; <a class=\"more-link\" href=\"https:\/\/pogar-video.ru\/?p=409\">\u0427\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043b\u0435\u0435 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[12],"tags":[22],"_links":{"self":[{"href":"https:\/\/pogar-video.ru\/index.php?rest_route=\/wp\/v2\/posts\/409"}],"collection":[{"href":"https:\/\/pogar-video.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pogar-video.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pogar-video.ru\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/pogar-video.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=409"}],"version-history":[{"count":0,"href":"https:\/\/pogar-video.ru\/index.php?rest_route=\/wp\/v2\/posts\/409\/revisions"}],"wp:attachment":[{"href":"https:\/\/pogar-video.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=409"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pogar-video.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=409"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pogar-video.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=409"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}