{"id":325093,"date":"2021-06-18T09:00:18","date_gmt":"2021-06-18T09:00:18","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=325093"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=325093","title":{"rendered":"22 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043a\u043e\u0434\u0430 \u043d\u0430 Python"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/jj\/qo\/xs\/jjqoxswcr5qbvgi5bvbqds8r2dy.jpeg\"><\/div>\n<p>  Python \u2014 \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0447\u0440\u0435\u0437\u0432\u044b\u0447\u0430\u0439\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0438 \u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u043f\u043e\u0432\u0441\u0435\u0434\u043d\u0435\u0432\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0432\u043a\u0440\u0430\u0442\u0446\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e 22 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u043a\u043e\u0434\u0430, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0445 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u043e\u0449\u044c\u044e Python.<\/p>\n<p>  \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0443\u0436\u0435 \u0432\u0438\u0434\u0435\u0442\u044c \u0440\u0430\u043d\u0435\u0435, \u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u0431\u0443\u0434\u0443\u0442 \u043d\u043e\u0432\u044b\u043c\u0438 \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u0432\u0430\u0441. \u0412\u0441\u0435 \u044d\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043b\u0435\u0433\u043a\u043e \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e\u0442\u0441\u044f.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>1. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0433\u043b\u0430\u0441\u043d\u044b\u0435<\/h2>\n<p>  \u042d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u0433\u043b\u0430\u0441\u043d\u044b\u0435 <code>&quot;a e i o u&quot;<\/code>. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \u043f\u0440\u0438 \u043f\u043e\u0438\u0441\u043a\u0435 \u0438\u043b\u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0438 \u0433\u043b\u0430\u0441\u043d\u044b\u0445.<\/p>\n<pre><code class=\"python\">def get_vowels(String):     return [each for each in String if each in &quot;aeiou&quot;] get_vowels(&quot;animal&quot;) # [a, i, a] get_vowels(&quot;sky&quot;) # [] get_vowels(&quot;football&quot;) # [o, o, a]<\/code><\/pre>\n<p>  <\/p>\n<h2>2. \u041f\u0435\u0440\u0432\u0430\u044f \u0431\u0443\u043a\u0432\u0430 \u0432 \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435<\/h2>\n<p>  \u042d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0435\u0440\u0432\u043e\u0439 \u0431\u0443\u043a\u0432\u044b \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u043f\u0440\u043e\u043f\u0438\u0441\u043d\u0443\u044e \u0431\u0443\u043a\u0432\u0443. \u041e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u043f\u0440\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0435 \u0442\u0435\u043a\u0441\u0442\u0430 \u0438\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0444\u0430\u0439\u043b \u0438 \u0442.\u043f.<\/p>\n<pre><code class=\"python\">def capitalize(String):     return String.title() capitalize(&quot;shop&quot;) # [Shop] capitalize(&quot;python programming&quot;) # [Python Programming] capitalize(&quot;how are you!&quot;) # [How Are You!]<\/code><\/pre>\n<p>  <\/p>\n<h2>3. \u041f\u0435\u0447\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438 N \u0440\u0430\u0437<\/h2>\n<p>  \u042d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0447\u0430\u0442\u0430\u0442\u044c \u043b\u044e\u0431\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 n \u0440\u0430\u0437 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0446\u0438\u043a\u043b\u043e\u0432 Python.<\/p>\n<pre><code class=\"python\">n=5 string=&quot;Hello World &quot; print(string * n)  #Hello World Hello World Hello World Hello World Hello World<\/code><\/pre>\n<p>  <\/p>\n<h2>4. \u041e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u043c \u0434\u0432\u0430 \u0441\u043b\u043e\u0432\u0430\u0440\u044f<\/h2>\n<p>  \u042d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u043b\u0438\u044f\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439 \u0432 \u043e\u0434\u0438\u043d.<\/p>\n<pre><code class=\"python\">def merge(dic1,dic2):     dic3=dic1.copy()     dic3.update(dic2)     return dic3 dic1={1:&quot;hello&quot;, 2:&quot;world&quot;} dic2={3:&quot;Python&quot;, 4:&quot;Programming&quot;} merge(dic1,dic2) # {1: 'hello', 2: 'world', 3: 'Python', 4: 'Programming'}<\/code><\/pre>\n<p>  <\/p>\n<h2>5. \u0412\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f<\/h2>\n<p>  \u042d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u043b\u0435\u0437\u0435\u043d, \u043a\u043e\u0433\u0434\u0430 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<pre><code class=\"python\">import time start_time= time.time() def fun():     a=2     b=3     c=a+b end_time= time.time() fun() timetaken = end_time - start_time print(&quot;Your program takes: &quot;, timetaken) # 0.0345<\/code><\/pre>\n<p>  <\/p>\n<h2>6. \u041e\u0431\u043c\u0435\u043d \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043c\u0435\u0436\u0434\u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438<\/h2>\n<p>  \u042d\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u0431\u043c\u0435\u043d\u044f\u0442\u044c \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u0434\u0432\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0440\u0435\u0442\u044c\u0435\u0439.<\/p>\n<pre><code class=\"python\">a=3 b=4 a, b = b, a print(a, b) # a= 4, b =3<\/code><\/pre>\n<p>  <\/p>\n<h2>7. \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u043e\u0432<\/h2>\n<p>  \u042d\u0442\u043e \u0441\u0430\u043c\u044b\u0439 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435.<\/p>\n<pre><code class=\"python\">def check_duplicate(lst):     return len(lst) != len(set(lst)) check_duplicate([1,2,3,4,5,4,6]) # True check_duplicate([1,2,3]) # False check_duplicate([1,2,3,4,9]) # False<\/code><\/pre>\n<p>  <\/p>\n<h2>8. \u0424\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 False<\/h2>\n<p>  \u042d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u043b\u043e\u0436\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <code>false, 0, None, &quot; &quot;<\/code>.<\/p>\n<pre><code class=\"python\">def Filtering(lst):     return list(filter(None,lst)) lst=[None,1,3,0,&quot;&quot;,5,7] Filtering(lst) #[1, 3, 5, 7]<\/code><\/pre>\n<p>  <\/p>\n<h2>9. \u0420\u0430\u0437\u043c\u0435\u0440 \u0432 \u0431\u0430\u0439\u0442\u0430\u0445<\/h2>\n<p>  \u042d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0434\u043b\u0438\u043d\u0443 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0431\u0430\u0439\u0442\u0430\u0445, \u0447\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439.<\/p>\n<pre><code class=\"python\">def ByteSize(string):     return len(string.encode(&quot;utf8&quot;)) ByteSize(&quot;Python&quot;) #6 ByteSize(&quot;Data&quot;) #4<\/code><\/pre>\n<p>  <\/p>\n<h2>10. \u0417\u0430\u043d\u044f\u0442\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c<\/h2>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0431\u044a\u0451\u043c \u043f\u0430\u043c\u044f\u0442\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u043b\u044e\u0431\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0432 Python.<\/p>\n<pre><code class=\"python\">import sys var1=&quot;Python&quot; var2=100 var3=True print(sys.getsizeof(var1)) #55 print(sys.getsizeof(var2)) #28 print(sys.getsizeof(var3)) #28<\/code><\/pre>\n<p>  <\/p>\n<h2>11. \u0410\u043d\u0430\u0433\u0440\u0430\u043c\u043c\u044b<\/h2>\n<p>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0442\u043e\u0433\u043e, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u0430\u043d\u0430\u0433\u0440\u0430\u043c\u043c\u043e\u0439. \u0410\u043d\u0430\u0433\u0440\u0430\u043c\u043c\u0430 \u2014 \u044d\u0442\u043e \u0441\u043b\u043e\u0432\u043e, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 \u0431\u0443\u043a\u0432 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430.<\/p>\n<pre><code class=\"python\">from collections import Counter def anagrams(str1, str2):     return Counter(str1) == Counter(str2) anagrams(&quot;abc1&quot;, &quot;1bac&quot;) # True<\/code><\/pre>\n<p>  <\/p>\n<h2>12. \u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0441\u043f\u0438\u0441\u043a\u0430<\/h2>\n<p>  \u042d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a. \u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u2014 \u044d\u0442\u043e \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430 \u0441 \u0446\u0438\u043a\u043b\u043e\u043c, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0441\u0432\u043e\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438.<\/p>\n<pre><code class=\"python\">my_list = [&quot;leaf&quot;, &quot;cherry&quot;, &quot;fish&quot;] my_list1 = [&quot;D&quot;,&quot;C&quot;,&quot;B&quot;,&quot;A&quot;] my_list2 = [1,2,3,4,5]  my_list.sort() # ['cherry', 'fish', 'leaf'] my_list1.sort() # ['A', 'B', 'C', 'D'] print(sorted(my_list2, reverse=True)) # [5, 4, 3, 2, 1]<\/code><\/pre>\n<p>  <\/p>\n<h2>13. \u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0441\u043b\u043e\u0432\u0430\u0440\u044f<\/h2>\n<p>  <\/p>\n<pre><code class=\"python\">orders = {  'pizza': 200,  'burger': 56,  'pepsi': 25,     'Coffee': 14 } sorted_dic= sorted(orders.items(), key=lambda x: x[1]) print(sorted_dic)  # [('Coffee', 14), ('pepsi', 25), ('burger', 56), ('pizza', 200)]<\/code><\/pre>\n<p>  <\/p>\n<h2>14. \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0441\u043f\u0438\u0441\u043a\u0430<\/h2>\n<p>  <\/p>\n<pre><code class=\"python\">my_list = [&quot;Python&quot;, &quot;JavaScript&quot;, &quot;C++&quot;, &quot;Java&quot;, &quot;C#&quot;, &quot;Dart&quot;] #method 1 print(my_list[-1])  # Dart #method 2 print(my_list.pop()) # Dart<\/code><\/pre>\n<p>  <\/p>\n<h2>15. \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u044f\u0442\u044b\u043c\u0438 \u0441\u043f\u0438\u0441\u043a\u0430 \u0432 \u0441\u0442\u0440\u043e\u043a\u0443<\/h2>\n<p>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u0437\u0430\u043f\u044f\u0442\u044b\u043c\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0432 \u0435\u0434\u0438\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443. \u0415\u0433\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0432\u0435\u0441\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u043e\u0439.<\/p>\n<pre><code class=\"python\">my_list1=[&quot;Python&quot;,&quot;JavaScript&quot;,&quot;C++&quot;] my_list2=[&quot;Java&quot;, &quot;Flutter&quot;, &quot;Swift&quot;] #example 1 &quot;My favourite Programming Languages are&quot; , &quot;, &quot;.join(my_list1)) # My favourite Programming Languages are Python, JavaScript, C++ print(&quot;, &quot;.join(my_list2))  # Java, Flutter, Swift<\/code><\/pre>\n<p>  <\/p>\n<h2>16. \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0430\u043b\u0438\u043d\u0434\u0440\u043e\u043c\u043e\u0432<\/h2>\n<p>  \u042d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u0430\u043b\u0438\u043d\u0434\u0440\u043e\u043c\u043e\u0432.<\/p>\n<pre><code class=\"python\">def palindrome(data):     return data == data[::-1]      palindrome(&quot;level&quot;) #True palindrome(&quot;madaa&quot;) #False<\/code><\/pre>\n<p>  <\/p>\n<h2>17. \u041f\u0435\u0440\u0435\u043c\u0435\u0448\u0438\u0432\u0430\u043d\u0438\u0435 \u0441\u043f\u0438\u0441\u043a\u0430<\/h2>\n<p>  <\/p>\n<pre><code class=\"python\">from random import shuffle my_list1=[1,2,3,4,5,6] my_list2=[&quot;A&quot;,&quot;B&quot;,&quot;C&quot;,&quot;D&quot;] shuffle(my_list1) # [4, 6, 1, 3, 2, 5] shuffle(my_list2) # ['A', 'D', 'B', 'C']<\/code><\/pre>\n<p>  <\/p>\n<h2>18. \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u043d\u0438\u0436\u043d\u0438\u0439 \u0438 \u0432\u0435\u0440\u0445\u043d\u0438\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b<\/h2>\n<p>  <\/p>\n<pre><code class=\"python\">str1 =&quot;Python Programming&quot; str2 =&quot;IM A PROGRAMMER&quot; print(str1.upper()) #PYTHON PROGRAMMING print(str2.lower()) #im a programmer<\/code><\/pre>\n<p>  <\/p>\n<h2>19. \u0424\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438<\/h2>\n<p>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443. \u041f\u043e\u0434 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0432 Python \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043a \u0441\u0442\u0440\u043e\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445.<\/p>\n<pre><code class=\"python\">#example 1 str1 =&quot;Python Programming&quot; str2 =&quot;I'm a {}&quot;.format(str1)   # I'm a Python Programming #example 2 - another way str1 =&quot;Python Programming&quot; str2 =f&quot;I'm a {str1}&quot;    # I'm a Python Programming<\/code><\/pre>\n<p>  <\/p>\n<h2>20. \u041f\u043e\u0438\u0441\u043a \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438<\/h2>\n<p>  \u042d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435. \u042f \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e \u0435\u0433\u043e \u0434\u0432\u0443\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u043c\u0438 \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<pre><code class=\"python\">programmers = [&quot;I'm an expert Python Programmer&quot;,                &quot;I'm an expert Javascript Programmer&quot;,                &quot;I'm a professional Python Programmer&quot;                &quot;I'm a beginner C++ Programmer&quot; ] #method 1 for p in programmers:     if p.find(&quot;Python&quot;):         print(p) #method 2 for p in programmers:     if &quot;Python&quot; in p:         print(p)<\/code><\/pre>\n<p>  <\/p>\n<h2>21. \u041f\u0435\u0447\u0430\u0442\u044c \u0432 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435<\/h2>\n<p>  \u041c\u044b \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f print \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0432\u044b\u0432\u043e\u0434 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435, \u0438 \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 print, \u043e\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442 \u043f\u0435\u0447\u0430\u0442\u044c \u0432 \u0434\u0432\u0435 \u0441\u0442\u0440\u043e\u043a\u0438. \u042d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u043a\u0430\u0436\u0435\u0442, \u043a\u0430\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0432\u044b\u0432\u043e\u0434 \u0432 \u0442\u043e\u0439 \u0436\u0435 \u0441\u0442\u0440\u043e\u043a\u0435 \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043d\u0430 \u043d\u043e\u0432\u0443\u044e.<\/p>\n<pre><code class=\"python\"># fastest way import sys sys.stdout.write(&quot;Call of duty &quot;) sys.stdout.write(&quot;and Black Ops&quot;) # output: Call of duty and Black Ops #another way but only for python 3 print(&quot;Python &quot;, end=&quot;&quot;) print(&quot;Programming&quot;)  # output: Python Programming<\/code><\/pre>\n<p>  <\/p>\n<h2>22. \u0420\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435 \u043d\u0430 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b<\/h2>\n<p>  \u042d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u043a\u0430\u0436\u0435\u0442, \u043a\u0430\u043a \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u0430 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u043c\u0435\u043d\u044c\u0448\u0438\u0435 \u0447\u0430\u0441\u0442\u0438.<\/p>\n<pre><code class=\"python\">def chunk(my_list, size):     return [my_list[i:i+size] for i in range(0,len(my_list), size)] my_list = [1, 2, 3, 4, 5, 6] chunk(my_list, 2) # [[1, 2], [3, 4], [5, 6]]<\/code><\/pre>\n<hr>\n<p>  <\/p>\n<h4>\u041d\u0430 \u043f\u0440\u0430\u0432\u0430\u0445 \u0440\u0435\u043a\u043b\u0430\u043c\u044b<\/h4>\n<p>  <a href=\"https:\/\/vdsina.ru\/\">\u0421\u0435\u0440\u0432\u0435\u0440\u044b \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432<\/a> \u2014 \u0432\u044b\u0431\u043e\u0440 \u0441\u0440\u0435\u0434\u0438 \u043e\u0431\u0448\u0438\u0440\u043d\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u043f\u0440\u0435\u0434\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 ISO \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u041e\u0421, \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440 \u0442\u0430\u0440\u0438\u0444\u043d\u044b\u0445 \u043f\u043b\u0430\u043d\u043e\u0432 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0432 \u043f\u0430\u0440\u0443 \u043a\u043b\u0438\u043a\u043e\u0432, \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043c\u0438\u043d\u0443\u0442\u044b. \u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435!<\/p>\n<p>  \u041f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u043d\u0430 <a href=\"https:\/\/t.me\/vdsina\">\u043d\u0430\u0448 \u0447\u0430\u0442 \u0432 Telegram<\/a>.<\/p>\n<p>  <a href=\"https:\/\/vdsina.ru\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/z9\/pt\/ar\/z9ptarc6sq-j36_r3iugpra4ojw.png\"><\/a><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/vdsina\/blog\/563432\/\"> https:\/\/habr.com\/ru\/company\/vdsina\/blog\/563432\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/jj\/qo\/xs\/jjqoxswcr5qbvgi5bvbqds8r2dy.jpeg\"><\/div>\n<p>  Python \u2014 \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0447\u0440\u0435\u0437\u0432\u044b\u0447\u0430\u0439\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0438 \u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u043f\u043e\u0432\u0441\u0435\u0434\u043d\u0435\u0432\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0432\u043a\u0440\u0430\u0442\u0446\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e 22 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u043a\u043e\u0434\u0430, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0445 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u043e\u0449\u044c\u044e Python.<\/p>\n<p>  \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0443\u0436\u0435 \u0432\u0438\u0434\u0435\u0442\u044c \u0440\u0430\u043d\u0435\u0435, \u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u0431\u0443\u0434\u0443\u0442 \u043d\u043e\u0432\u044b\u043c\u0438 \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u0432\u0430\u0441. \u0412\u0441\u0435 \u044d\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043b\u0435\u0433\u043a\u043e \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e\u0442\u0441\u044f.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-325093","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/325093","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=325093"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/325093\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=325093"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=325093"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=325093"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}